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

RE: Namespace problem

Subject: RE: Namespace problem
From: Marc Schneider <mschneider@xxxxxxxxx>
Date: Mon, 13 Sep 2004 17:58:16 -0400
xsl namespace xsd
I'm not sure if that is what Dave meant, but it doesn't appear to be what I'm seeing.

For example, given the following partial WSDL (part of the UDDI WSDL) file:

<definitions xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:tns="urn:uddi-org:inquiry_v2"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:uddi="urn:uddi-org:api_v2" targetNamespace="urn:uddi-org:inquiry_v2" name="UDDI_Inquiry_API_V2">
<documentation> Copyright (c) 2000 - 2002 by Accenture, Ariba, Inc.,
Commerce One, Inc. Fujitsu Limited, Hewlett-Packard Company, i2
Technologies, Inc., Intel Corporation, International Business Machines
Corporation, Microsoft Corporation, Oracle Corporation, SAP AG, Sun
Microsystems, Inc., and VeriSign, Inc. All Rights Reserved. WSDL Service
Interface for UDDI Inquiry API V2.0 This WSDL document defines the
inquiry API calls for interacting with the UDDI registry. The complete
UDDI API specification is available at
http://www.uddi.org/specification.html. </documentation>
<types>
<xsd:schema targetNamespace="urn:uddi-org:inquiry_v2" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:import namespace="urn:uddi-org:api_v2" schemaLocation="http://www.uddi.org/schema/uddi_v2.xsd"/>
</xsd:schema>
</types>
<message name="bindingDetail">
<part name="body" element="uddi:bindingDetail"/>
</message>
...



When processing the <part> element, namespace::* is only the default namespace (i.e. if I include a <xsl:copy-of select="namespace::*"> in the template that processes the <part>element the result is xmlns="http://schemas.xmlsoap.org/wsdl/"). There seems to be no simple way (or at least I haven't found it) to resolve the prefix uddi at this point when using XalanC.


Marc

At 05:48 PM 9/13/2004, you wrote:
My reading of Dave's response was that in Xalan-C the namespace axis does
return all in-scope namespaces, but that you cannot reliably obtain the
parent element of a namespace node. So rather than accessing the parent of
the namespace node using the parent axis, you need to save it (the parent
element) in a variable. Is that correct?

Michael Kay

> -----Original Message-----
> From: Marc Schneider [mailto:mschneider@xxxxxxxxx]
> Sent: 13 September 2004 22:36
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject: Re:  Namespace problem
>
> Dave -
>
> Since WSDL files have QName in attributes, the namespace
> prefix in the
> attribute can be any in-scope namespace. This deviation from
> the XPath data
> model makes it very difficult to process WSDL files.
>
> Marc
>
> At 04:27 PM 9/13/2004, you wrote:
> > > Hello -
> > >
> > > I may have spoken too soon when I said that using
> current() did the
> >trick.
> > > This apparently works in XalanJ, but XalanC v1.7 appears to have a
> >problem
> > > with namespace::* and doesn't evaluate
> namespace::*[starts-with(name(),
> > > substring-before(current()/parent::node()/@name,':'))] correctly.
> > >
> > > Unfortunately, I need to support XalanC v1.7, does anyone
> know of a way
> >to
> > > resolve a namespace URI from the prefix in XalanC 1.7?
> >
> >This is a case where Xalan-C deviates from the XPath data
> model, and does
> >not have a namespace node for every in-scope namespace on
> every element.
> >The following stylesheet produces the desired result:
> >
> ><?xml version="1.0"?>
> ><xsl:stylesheet
> >     xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> >         xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
> >         version="1.0">
> >
> ><xsl:output encoding="utf-8" />
> >
> ><xsl:template match="wsdl:operation">
> >   <xsl:element name="operation">
> >     <xsl:choose>
> >       <xsl:when test="contains(parent::node()/@name,':')">
> >           <xsl:variable name="ns"
> >select="substring-before(parent::node()/@name, ':')" />
> >         <xsl:attribute name="portType_nspc">
> >           <xsl:choose>
> >             <xsl:when test="contains(parent::node()/@name,':')">
> >               <xsl:value-of select="namespace::*[name() = $ns]"/>
> >             </xsl:when>
> >             <xsl:otherwise>
> >               <xsl:value-of
> >select="ancestor::*[last()]/@targetNamespace"/>
> >             </xsl:otherwise>
> >           </xsl:choose>
> >         </xsl:attribute>
> >       </xsl:when>
> >       <xsl:otherwise>
> >         <xsl:attribute name="portType_nspc"/>
> >       </xsl:otherwise>
> >     </xsl:choose>
> >   </xsl:element>
> ></xsl:template>
> >
> ></xsl:stylesheet>
> >
> >I've been tempted numerous times to fix this deviation, but the cases
> >where this has caused a problem have been extremely rare,
> and the cost in
> >memory overhead is considerable in many cases.
> >
> >Dave

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.