This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes XML and Related Technologies and the fly likes Comment Handling while parsing and building an xml file in xerces Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "Comment Handling while parsing and building an xml file in xerces" Watch "Comment Handling while parsing and building an xml file in xerces" New topic
Author

Comment Handling while parsing and building an xml file in xerces

liinaa
Greenhorn

Joined: Sep 21, 2001
Posts: 5
I am using a xerces parser DOM API. I need to handle xml comments while parsing and building an xml file. while building the xml file, i need to insert an xml comment node...
Can someone help me out with this??
Thanks
Palani kumar
Greenhorn

Joined: Sep 01, 2001
Posts: 12
Hai
there is an method in Document to create comment
Comment comment = Document.createComment("Specify comment to be added");
then as usual you can append as a child to the node you want to add using the appendChild() method

Cheers
Palanikumar

------------------
In the end everything is Right,If it's not then It's not the End


In the end everything is Right,If it's not then It's not the End
 
Don't get me started about those stupid light bulbs.
 
subject: Comment Handling while parsing and building an xml file in xerces