I am working on a DOM application in which I would
like to suppress the generation of blank nodes to make the tree easier to work
with. To do this, I call xmlKeepBlanksDefault(0) which seems to work
pretty well. However, I have recently run across a situation in which I
have found that if a line in an XML file does not end with a newline character
immediately after the closing '>' character, a blank node is inserted into
the DOM tree. In other words, some extra whitespace is present before the
newline.
For example (using \n to represent newline), this
is OK (no blank nodes):
<a>\n
<b>
this causes a blank node:
<a> \n
<b>
Is this the way it is supposed to work (i.e. is
this considered 'significant' whitespace) or is this a bug?
Regards,
Ed Day
|