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?

Consider
<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
libxml.

Liam

-- 
Liam Quin - XML Activity Lead, W3C, http://www.w3.org/People/Quin/
Pictures from old books: http://fromoldbooks.org/
Ankh: irc.sorcery.net irc.gnome.org www.advogato.org




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