Re: [xml] Undefined character entities and libxml



Section 2.3 of the XPath spec seems to apply:

A QName in the node test is expanded into an expanded-name using the
namespace declarations from the expression context. This is the same
way expansion is done for element type names in start and end-tags
except that the default namespace declared with xmlns is not used: if
the QName does not have a prefix, then the namespace URI is null (this
is the same way attribute names are expanded). It is an error if the
QName has a prefix for which there is no namespace declaration in the
expression context.

My query works like this:
    set = doc.find('//foo:div', 'foo:http://www.w3.org/1999/xhtml')

There doesn't seem to be any way to set a default namespace for the
query pattern.

I'm starting to understand now why people put XML into strings and use
regexp to extract the desired patterns.

--
Jon Smirl
jonsmirl gmail com



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]