[
Lists Home |
Date Index |
Thread Index
]
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
|