XML::LibXML - Mixing XPath with a document fragment

Emmanuel Rodriguez <[email protected]>
Newsgroups gmane.comp.lang.perl.xml
Message-ID <[email protected]>
Hi,

I have an XML document that was generated with document fragments by
an external function. This gave me some struggle because I was trying
to use an XPath expression to access some nodes and couldn't reach
them. This is due to the fact that even though the document fragment
seems transparent it's still in the document and brakes the
parent/child/sibling relation ship. This makes it a difficult to use
XPath to search for nodes.

Is there a way to clean document of all document fragments besides
$xml = XML::LibXML->new()->parse_string($xml->toString()); ?
Should document fragments be avoided?

For the curious, I have attached a test case that shows the problems I
had parsing the document.

-- 
Emmanuel Rodriguez

_______________________________________________
Perl-XML mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
fragment.t (application/x-troff, 2.1 KB) - not displayed
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.