[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

XPath and root-less namespace problem

Subject: XPath and root-less namespace problem
From: "Ken Shino" <kenji@xxxxxxxxxxx>
Date: Wed, 14 May 2003 20:41:13 -0400
xpath namespace problem
Hello all:

I'm running into a bit of a snag trying to create an XSL that will parse the
following information:

<definitions xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:xs="http://www.w3.org/2001/XMLSchema" name="IZPOP3service"
targetNamespace="http://www.zanetti-dev.com/"
xmlns:tns="http://www.zanetti-dev.com/"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
xmlns:ns1="http://www.zanetti-dev.com/XMLSchema"
xmlns:ns2="http://www.borland.com/namespaces/Types">
  <service name="IZPOP3service">
    <port name="IZPOP3Port" binding="tns:IZPOP3binding">
      <soap:address
location="http://www.zanetti-dev.com/scripts/zpop3ws.exe/soap/IZPOP3"/>
    </port>
  </service>
</definitions>

My XPath of:

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

returns nothing.

However, if I remove the "xmlns='http://schemas.xmlsoap.org/wsdl'" from my
code, it works BEAUTIFULLY.  I can fully traverse this file, and can do any
XPath I want to.  But that's not the right way to do this.

What am I doing wrong?  Short of writing some code that will remove any
occurances of the words "xmlns='pattern'" from an XML document, I need to
figure this out.

I've been able to grab the Node.getDocumentElement() and try a query using
the above XPath, but nothing has worked.  I've even tried an arbitrary
namespace call of:

    //noexist:definitions/service/port ... /@location

And various deviations of that, and it still doesn't work.  I'm at an
impass - my code with namespaces that are non-root work.  Root namespaces
break everything.

Can anyone shed some light as to what I might be doing wrong and/or how to
fix this so it works?

-- Ken


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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.