File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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 Head First Android this week in the Android 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
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Comment Handling while parsing and building an xml file in xerces
 
It's not a secret anymore!