This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes XML and Related Technologies and the fly likes crimson error encountered Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "crimson error encountered" Watch "crimson error encountered" New topic
Author

crimson error encountered

JayaSiji Gopal
Ranch Hand

Joined: Sep 27, 2004
Posts: 303
Hi,

I have the following program to write an xml file.



I get the following error:

org.apache.crimson.tree.DomEx: HIERARCHY_REQUEST_ERR: This node isn't allowed there.
at org.apache.crimson.tree.XmlDocument.appendChild(XmlDocument.java:661)
at CreateXML.buildXML(CreateXML.java:74)
at CreateXML.getDateAndTime(CreateXML.java:57)
at CreateXML.main(CreateXML.java:47)

Could someone plz tell me the reason for this??


SCJP 1.4, SCWCD 1.4<br /> <br />Thanks in advance!<br />Jayashree.
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12760
    
    5
Why you chose to reproduce the whole thing in your post when the error was in line 74, I just can't imagine.

Look at the JavaDocs for Node Interface, appendChild method in the org.w3c.dom package.
You will instantly see that HIERARCHY_REQUEST_ERR can be thrown if the Node is of type Document and you try to append an Element to it.
Sheesh!
Bill
JayaSiji Gopal
Ranch Hand

Joined: Sep 27, 2004
Posts: 303
Hi!

Thank u for the solution. My program just works fine. Yep!! I realize my mistake.

However, I do come across people in this forum, who ask for the whole code to understand the error!!!
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: crimson error encountered
 
Similar Threads
Wrong month
i want to get the month of a particular date
switch ??
conversion of month
learning how to use classes