Do you have a question? Post it now! No Registration Necessary. Now with pictures!
January 12, 2010, 9:58 am
rate this thread
to using XML::LibXML (new hotness).
At the moment, when handling the sprawling nightmare that
is AdsML, I exploit "namespace" processing provided by the underlying
Quoting the docs:
"When this option is given with a true value, then the
parser does namespace processing. By default, namespace processing
is turned off. When it is turned on, the parser consumes
xmlns attributes and strips off prefixes from element
and attributes names where those prefixes have a defined namespace."
Since AdsML is (in practice) versbose and redundant, it is unambiguous
at the level of XPath's without needing to handle namespaces.
I would like to retain this pragmatic convenience.
But it appears that XML::LibXML, and XML::LibXML::Parser,
XML::LibXML::XPathContext are keen to force me to handle
namespaces explicitly, which is a workload I could well do without.
The parser is keen to retain namespaces, and XPath is keen
for me to name them all.
I have considered walking the DOM tree to set all the namespaces
of all the nodes to "default", but I suspect this would have performance
Any "shortcuts" would be welcomed.
- » Posting Guidelines for comp.lang.perl.misc ($Revision: 1.9 $)
- — Previous thread in » PERL Discussions