[xml] XML_PARSE_NOBLANKS and CR/LF



Hi All,

I am experiencing some problems using XML_PARSE_NOBLANKS and libxml2
(2.6.7) on Windows plateforms.

When my input file has several blank lines in a row, libxml2 does not
consider that is a blank, and creates a node.

So I tested with linux or mac files (only CR or LF), and it worked as
exepected (no text nodes created).

A annoying consequence in my case is when using xmlSaveFormatFile, the
simple fact to have a text node as child desactivates the formatting
(which is very nice in other cases).

I have not found the reason of this behaviour ; in the parser's code CR
and LF seems to be treated as equal in areBlanks (except in some strange
loops as  "while (*in == 0xA) {  ctxt->input->line++; in++; }"
(parser.c:3118)

Has anybody an idea ?

Thanks,

--
Rémi Peyronnet



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