Re: A whitespace issue in XML::LibXML
by Birgit Kellner other posts by this author
Jul 20 2007 11:27AM messages near this date
view in the new Beta List Site
Re: A whitespace issue in XML::LibXML
|
Re: A whitespace issue in XML::LibXML
& XSLT Petr Pajas schrieb:
> First of all, why do you do that "by hand"? To get all text nodes
> from a subtree nicely concatenated, you can use e.g.
>
> $text = $node->findvalue('string(.)')
>
I should have been more specific on that. I'm not interested in all text
nodes, but in text node children of the element <seg> , and in text node
children of the element <span> that can be contained within <seg>. <seg>
can also contain further elements which in turn contain text nodes, and
I don't want to get their content.
> Without a DTD or schema, there is no reasonable way to distinguish
> ignorable whitespace and non-ignorable whitespace in XML. You can
> try setting $parser->keep_blanks(0) before you parse the XML into
> memory and see if it solves you problem.
>
> -- Petr
>
>
Thanks - this does do the trick, actually.
Birgit
_______________________________________________
Perl-XML mailing list
Perl-XML@[...].com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Thread:
Birgit Kellner
Petr Pajas
Birgit Kellner
A. Pagaltzis
Vaclav Barta
Birgit Kellner
Richard E. Rathmann
Vaclav Barta
Petr Pajas
Vaclav Barta
Mark - BLS CTR Thomas
|