On 12/17/05, Daniel Veillard <[EMAIL PROTECTED]> wrote: > On Sat, Dec 17, 2005 at 03:15:05PM -0500, Jon Smirl wrote: > > Something is not quite right in the ruby XPath wrapper. > > > > I have this XHTML with some <div> in the document. > > <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> > > > > XPath //div should return the <div> but it doesn't find anything. > > No. XPath beginner mistake #1 . default namespace are a namespace > the match is not syntactic it's based on the namespace property too
I can see that the namespace needs to be part of the query, but this part of the XPath spec is not obvious to me: "if the QName does not have a prefix, then the namespace URI is null (this is the same way attribute names are expanded)". What is the logic behind setting the QName namespace to null instead of picking up the default namespace definition from the target document? If it picked up the default from the document the query would have worked. > > This has probably be raised dozens of time on this list and thousands > on common archives and FAQs. > > Daniel > > -- > Daniel Veillard | Red Hat http://redhat.com/ > [EMAIL PROTECTED] | libxml GNOME XML XSLT toolkit http://xmlsoft.org/ > http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/ > -- Jon Smirl [EMAIL PROTECTED] _______________________________________________ xml mailing list, project page http://xmlsoft.org/ [email protected] http://mail.gnome.org/mailman/listinfo/xml
