Re: [xml] SelectSingleNode



On 5/3/2011 06:46, Daniel Veillard wrote:
On Mon, May 02, 2011 at 03:47:04PM -0400, Paul B. Cameron wrote:
In this particular case, however, I know how to format and register the
namespace information before evaluating the query. The challenge is
obtaining the set of namespaces declared by the instance document in the
first place.
   Unfortunately the Microsoft API doesn't make much sense I'm afraid
(or I misunderstand it), because a namespace URI may be bound to
multiple prefixes on a document, and a given prefix may be bound to
different namespace on a given document. So asking at the document
level doesn't make sense to me.
   What you can do is ask for the list of namespaces in scope for
a given element, libxml2 has an aPI for this:
   http://xmlsoft.org/html/libxml-tree.html#xmlGetNsList
It's not exactly that it seems. Their SDK has an example code for that, so it does:

- get namespace URI for document element;
- use that namespace URI to get a particular schema interface from collection returned from get_namespaces().

So this is only about schemas I think.

The reason it's a stub in Wine is most likely that nobody needed it.
   Note that the namespace prefix used in an XPath query is not significant,
the XPath matching will be done only on th namespace name, never the prefix.

Daniel





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