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

Re: Namespace problem

Subject: Re: Namespace problem
From: Josh Canfield <joshcanfield@xxxxxxxxx>
Date: Fri, 10 Sep 2004 23:58:09 -0700
xslt namespace problem
Hmm... Your code works in Saxon 8.0, but fails with Xalan 2.5.2.

It appears that the namespace axis is returning the namespace nodes
from the stylesheet instead of the context node.

Josh


On Fri, 10 Sep 2004 18:21:08 -0400, Marc Schneider <mschneider@xxxxxxxxx> wrote:
> I'm working on a stylesheet to process an XML (WSDL) file where some of the
> attribute are QNames. I need to separate the QName in the namespace URI and
> the local name. I'm having trouble resolving the correct namespace URI.
> 
> I have the following template which is producing the wrong value for the
> attribute portType_nspc.
> 
>        <xsl:template match="wsdl:operation">
>                <xsl:element name="operation">
>                        <xsl:choose>
>                                <xsl:when test="contains(parent::node()/@name,':')">
>                                        <xsl:attribute name="portType_nspc">
>                                                <xsl:choose>
>                                                        <xsl:when test="contains(parent::node()/@name,':')">
>                                                                <xsl:value-of
> select="namespace::*[starts-with(name(),substring-before(parent::node()/@name,':'))]"/>
>                                                        </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>
> 
> when run on the following document
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <definitions xmlns="http://schemas.xmlsoap.org/wsdl/" name="TemperatureService"
>        targetNamespace="http://www.xmethods.net/sd/TemperatureService.wsdl"
>        xmlns:tns="http://www.xmethods.net/sd/TemperatureService.wsdl">
>        <portType name="tns:TemperaturePortType">
>                <operation name="tns:getTemp">
>                        <input message="tns:getTempRequest"/>
>                        <output message="tns:getTempResponse"/>
>                </operation>
>        </portType>
> </definitions>
> 
> I'm getting
> 
>        <operation portType_nspc="http://www.w3.org/XML/1998/namespace"/>
> 
> when I expect to get
> 
>        <operation
> portType_nspc="http://www.xmethods.net/sd/TemperatureService.wsdl"/>
> 
> I've tried it with several different versions of Xalan (both C++ and Java
> versions) and get the same results.
> 
> Any ideas as to what is going wrong?
> 
> Marc

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.