Re: [xml] iterating through an XML document?

On Thu, 2007-06-14 at 01:25 +0200, Torsten Mohr wrote:

But it seems that too many text nodes are output, also for nodes that
do not have any content there is a text node with some whitespace characters
in it.

Do you know why this could happen?  How can i skip them?

<p><em>It's all</em> <b>exciting!</b></p>
and you'll see that the space between </em> and <b> is important.

If you write a DTD, you can have libxml discard space in "element
only context", i.e. where no text is allowed other than spaces.
But otherwise you'll get all the spaces.

This is a consequence of how XML works, and is not limited to


Liam Quin - XML Activity Lead, W3C,
Pictures from old books:

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]