Re: [xml] Undefined character entities and libxml
- From: Jon Smirl <jonsmirl gmail com>
- To: veillard redhat com
- Cc: xml gnome org
- Subject: Re: [xml] Undefined character entities and libxml
- Date: Sat, 17 Dec 2005 20:51:26 -0500
On 12/17/05, Daniel Veillard <veillard redhat com> 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/
veillard redhat com | libxml GNOME XML XSLT toolkit http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
--
Jon Smirl
jonsmirl gmail com
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]