I found that I did not like the fact that DOMWriter puts out blank lines
in certain contexts, so I modified DOMWriterImpl.cpp to put an end to
that. I basically searched for any occurrences of printNewLine() that
was within a few lines of another occurrence and removed one of them. I
"fixed" 5 instances. Take a look at the code Gareth suggested; it may
be that removing the following lines accomplishes what you want:
if(level == 1)
printNewLine();
I did not submit my changes as a patch because the current behavior is
reasonable and clearly intentional; it just doesn't happen to be to my
taste. As Gareth pointed out, "pretty" is in the eye of the beholder.
I'm happy to make a patch against the current code if it might get
applied.
-----Original Message-----
From: T MacAdam [mailto:[EMAIL PROTECTED]
Sent: Wednesday, August 04, 2004 10:15 PM
To: [EMAIL PROTECTED]
Subject: Still no luck with blank lines around CDATA sections (easily
repeatable!)
I posted a question recently regarding blank lines being introduced
around CDATA sections by DOMWriter.
I didn't get any responses, and I've spent more time testing things and
still have no solution. The problem can easily be reproduced by simply
running a simple XML file containing a CDATA section through the
DOMPrint sample that comes with Xerces (making sure pretty printing is
turned on). For example, my simple XML file contains:
<?xml version="1.0" encoding="UTF-8" standalone="no"
?>
<script>
<![CDATA[Some Text]]>
</script>
When I run it through DOMPrint using:
C:\>DOMPrint -wfpp=on TestSimple.xml
I get the following output:
<?xml version="1.0" encoding="UTF-8" standalone="no"
?>
<script>
<![CDATA[Some Text]]>
</script>
If I save that output to a file and run it through, I get even more
blank lines!
I'm beginning to think it's a bug; a file should not grow like this when
saved repeatedly should it? I did get the latest from CVS and I began
to dig into the code differences between the two versions, but Xerces is
so big I didn't get very far. Could anyone point me in the right
direction as to where to start looking? Also, could someone confirm
whether or not a Unix or Linux version does the same. If not, could it
be something about end-of-line character conversion on Windows?
Thanks in advance...
Tom.
P.S. my last message is in the archives at:
http://marc.theaimsgroup.com/?l=xerces-c-dev&m=109098018927374&w=2
__________________________________
Do you Yahoo!?
Yahoo! Mail is new and improved - Check it out!
http://promotions.yahoo.com/new_mail
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]