Re: [PHP-XML-DEV] DomXPath and default XML namespaces
[email protected] (Dan Phiffer) Mon, 13 Dec 2004 21:45:50 -0800
| Newsgroups | php.general,php.xml.dev |
|---|---|
| Message-ID | <[email protected]> |
Adam Maccabee Trachtenberg wrote: > This is an XPath FAQ. Without a ns prefix, XPath doesn't choose > elements living in the default ns, but ones living in no namespace. Are there any good references you might point me to? I'm pretty new to this stuff and beyond my "in a Nutshell" book don't have many places to consult yet. > what happens to: > > <root> > <foo> > <qxx/> > </foo> > <foo xmlns="bar"> > <qxx/> > </foo> > </root> > > And /root/foo/qxx? Do you select qxx in the default ns? Or not? > > -adam > That makes perfect sense. I'm realizing that XPaths are not as portable as I thought they were. At least not without some way of converting element prefixes easily... Thanks, -Dan