Re: [xml] Additional text nodes for '\n' in documents with DTD

On Sat, Feb 13, 2010 at 07:17:52PM +0300, Nikolay Sivov wrote:
I've just run into a problem I don't understand - when I parse a
document with dtd and
line returns '\n' in the content that followed dtd tree get
additional text nodes for each '\n'.

Inline example shows that. test2 produces text nodes - <doc> has 3
children (direct of course),
but <doc> from test1 has only one.

Note that without dtd I got the same trees in both cases.

Is it expected behavior?

  yes, spaces outside of markup constructs are significant and must be
reported to the application.

If so how to tell parser to not create
these text nodes?

  You can't. They are in the input, they must be in the output,


Daniel Veillard      | libxml Gnome XML XSLT toolkit
daniel veillard com  | Rpmfind RPM search engine | virtualization library

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