Next in thread → Next in month →

Re: [xml-dev] A Question about name spaces..

From
Bill de hÓra <>
To
Date
2005-03-06T13:08:22Z
ID
<>
Thread
Re: [xml-dev] A Question about name spaces..
Brian OBrien wrote:
> So what does one pass to XPath in order
> to extract an element?
> Are you supposed to know what prefix is going to be
> used?

No. if you had something like this:

   dom = toDom("<u:response xmlns:u='foobar'>resp</u:response>");

then you could use something like this:

  xpath = ...
  xpath.addPrefix("foobar", "x")
  responseText = xpath.eval(dom, "/x:response/text()")

ie, prefixes are relative to namespace bindings.

cheers
Bill
Next in thread → Next in month →