|
LibXML: Solution Found to XPath and Schema "default namespace" files.: msg#00085lang.perl.xml
Hi, Sorry for the question. I found the answer by looking around with Google (nothing on this list archive that was obvious). The problem was that my xpath queries wouldn't find anything in an xml file set with a default namespace. The solution was to use: root->setNamespace($NamespaceURI,'foo',1) to set the document root element with a non-null prefix and then use this prefix in the xpath queries. The above command will change things so that xpath can query the "in memory" nodes that now have a non-null namespace prefix. @nodelist = findnodes('//foo:someelement'); Definitely NON-OBVIOUS... Thanks be to Google! Les Richardson Open Admin for Schools _______________________________________________ Perl-XML mailing list Perl-XML@xxxxxxxxxxxxxxxxxxxxxxxx To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | LibXML: XPath and Schema "Encoded" XML File., Les Richardson |
|---|---|
| Next by Date: | LibXML: How do I serialize an attribute like this Attr="{" to file, Derek_Chen |
| Previous by Thread: | LibXML: XPath and Schema "Encoded" XML File., Les Richardson |
| Next by Thread: | LibXML: How do I serialize an attribute like this Attr="{" to file, Derek_Chen |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |