Darkwing has asked for the wisdom of the Perl Monks concerning the following question:
Hi Monks,
i use XML::LibXML for several years. Actually, i wanted to read an xml file containing some xinclude statements. I expected XML::LibXML to perform the include, but it doesn't. Example:
XML file foo.xml:
<?xml version="1.0"?> <foo> <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="bar.xml"/> </foo>
XML file bar.xml:
<?xml version="1.0"?> <bar> This is bar.xml! </bar>
Perl code:
use strict; use warnings; use XML::LibXML; my $dom = XML::LibXML->load_xml(location => "foo.xml"); print $dom->toString(1);
The above perl script prints:
<?xml version="1.0"?> <foo> <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="bar.xml"/ +> </foo>
Obviously, the <xi:include.../> has not been executed. Is there a way to tell XML::LibXML to do an include? Or is there another XML module that does the job?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Can i mange XML::LibXML to do an include? Or is there another XML module that does it?
by haukex (Archbishop) on Mar 29, 2019 at 10:21 UTC |