xsl-list
[Top] [All Lists]

RE: XPath and root-less namespace problem

2003-05-15 13:28:09

My XPath of:

    //definitions/service/port[(_at_)name='IZPOP3service']/*/@location

returns nothing.

However, if I remove the
"xmlns='http://schemas.xmlsoap.org/wsdl'" from my
code, it works BEAUTIFULLY. 

  //x:definitions/x:service/x:port[(_at_)name='IZPOP3service']/*/@location

with ns-prefix x bound to URL 
http://schemas.xmlsoap.org/wsdl/ will work.


Great.  How do I do this programmatically in Java?


It rather depends on what Java API you are using. There is no standard
Java API for XPath processing, but all the various APIs that I have seen
provide some mechanism for binding namespaces.

Michael Kay


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list