• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

crimson error encountered

 
Ranch Hand
Posts: 303
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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??
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 303
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
reply
    Bookmark Topic Watch Topic
  • New Topic