XML::LibXML Line Ending (whitespace) Problem.

Posted by Gilbeg on Stack Overflow See other posts from Stack Overflow or by Gilbeg
Published on 2010-05-10T05:29:12Z Indexed on 2010/05/10 5:44 UTC
Read the original article Hit count: 443

Filed under:
|
|
|
|

HI, I am parsing an XML file using LibXML in Perl. The problem that I have is the ending characters (whitespace) is treated as a text node. For instance, given an input like the following

abc 123

The parser thinks that the number of child of node "books" is 3, they are: - text node (containing the char between and - element node of "book" - text node (containing the char between and

Question is how do I tell LibXML to ignore whitespaces? I tried with no_blanks (that is $parser = XML::LibXML->new(no_blanks => 1) when construction the parser) but it seems that it has no effect.

Thanks in advance

© Stack Overflow or respective owner

Related posts about perl

Related posts about Xml