
Originally Posted by
wysota
Well I don't see you add the element to the tree, it is just hanging there alone... and the document should have some kind of root element too... Anyway, try adding newlines '\n' to your comments. I guess DOM encodes those comments as CDATA fields, so you can do whatever you want in them.
The problem with adding the \n to the comments is that the end of the comment ends up being right in frong of the next tag.
<!--?? This is the first comment
--><!--?? This is the second comment
--><element>
<!--?? This is the first comment
--><!--?? This is the second comment
--><element>
To copy to clipboard, switch view to plain text mode
I want it to look like this:
<!--?? This is the first comment-->
<!--?? This is the second comment-->
<element>
<!--?? This is the first comment-->
<!--?? This is the second comment-->
<element>
To copy to clipboard, switch view to plain text mode
Is there any way to force carriage returns in between tags?
Bookmarks