The Artima Developer Community
Sponsored Link

Java Answers Forum
creating XML child elements

1 reply on 1 page. Most recent reply: Aug 31, 2003 7:20 PM by Charles Bell

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 1 reply on 1 page
jonny smith

Posts: 1
Nickname: jonny99
Registered: Aug, 2003

creating XML child elements Posted: Aug 31, 2003 5:30 AM
Reply to this message Reply
Advertisement
I'm generating an XML document. I have reached the third hierarchial level i.e.

<level_1>
. <level_2>
. . <level_3>
. <level_2>
. . <level_3>
. <level_2>
<level_1>

Now I am trying to add <level_3> siblings to the existing <level_3> elements and am getting the following exception messages:

com.ibm.xml.parser.TXDOMException: com.ibm.xml.parser.TXNodeList#insert(): Wrong
index: 1
at com.ibm.xml.parser.TXNodeList.insert(TXNodeList.java)
at com.ibm.xml.parser.Parent.realInsert(Parent.java)
at com.ibm.xml.parser.Parent.insert(Parent.java)
at com.ibm.xml.parser.Parent.appendChild(Parent.java)
at Convertor.processNodeRecursively(Convertor.java:302)
at Convertor.processNodeRecursively(Convertor.java:320)
at Convertor.main(Convertor.java:86)

What does this mean and how do I correct this so I can continue creating elements at <level_3> of the XML doc.


Charles Bell

Posts: 519
Nickname: charles
Registered: Feb, 2002

Re: creating XML child elements Posted: Aug 31, 2003 7:20 PM
Reply to this message Reply
Your java program Converter.java should be using the xml standard node methods from the org.w3c.dom api for adding child nodes:


public Node appendChild(Node newChild) throws DOMException

Flat View: This topic has 1 reply on 1 page
Topic: problem with http authentication Previous Topic   Next Topic Topic: java programming

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use