• 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

How do I retain the comments?

 
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I am parsing a documents using:
DOMParser parser = new DOMParser();
parser.parse(uriCurrent);
current = parser.getDocument();
the xml document looks like this:
<?xml version="1.0" encoding="ISO-8859-1"?>
<!-- English message catalogue for Web Portal 3 -->
<catalogue xml:lang='en'>
<message key='copywrite.message'>Service powered by Spectel</message>
<!-- Generic Form Buttons -->
<message key='common.button.submit'>Login Current</message>
<message key='common.button.reset'>Reset</message>
<message key='common.button.back'>Back</message>
</catalogue>
However, when I come to printing out the document again, the comments are lost. Is there any way of retaining them?
Best regards,
John
 
John Cogan
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have discovered the answer to this:
case Node.COMMENT_NODE: {
out.write("<!--");
out.write(node.getNodeValue());
out.write("-->");
break;
needs to be included in the print out function.
Best regards,
John
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic