OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

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

[ 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




 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS