J
Jay Sartoris
Hi,
I'm adding a node to my XML document using DOM. When I serialize it,
I lose my comments that are above my root node. I've created an
OutputFormat obect and set the setOmitComments(false) but it still
removes the comments between my DOCTYPE tag and my root tag. I'm
pretty sure that the reason is that only the text within the root tags
are serialized. My comments within the root tags are still there
after serialization, just the comment outside of the root tags are
removed.
Here is a snippet of my xml doc:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plugin SYSTEM "plugin.dtd">
<!--
// my comment here
-->
<plugin id="plugin1">
..
..
..
</plugin>
Does anyone have any idea what I'm doing wrong?
Thanks in advance,
Jay
I'm adding a node to my XML document using DOM. When I serialize it,
I lose my comments that are above my root node. I've created an
OutputFormat obect and set the setOmitComments(false) but it still
removes the comments between my DOCTYPE tag and my root tag. I'm
pretty sure that the reason is that only the text within the root tags
are serialized. My comments within the root tags are still there
after serialization, just the comment outside of the root tags are
removed.
Here is a snippet of my xml doc:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plugin SYSTEM "plugin.dtd">
<!--
// my comment here
-->
<plugin id="plugin1">
..
..
..
</plugin>
Does anyone have any idea what I'm doing wrong?
Thanks in advance,
Jay