Well heres a way:
<xsl:template name="get-xmlschema-name">
<xsl:variable name="name">
<xsl:value-of select="name(/wsdl:definitions/wsdl:types/*)"/>
</xsl:variable>
<xsl:call-template name="get-namespace">
<xsl:with-param name="name" select="$name"/>
</xsl:call-template>
</xsl:template>
<xsl:template name="get-namespace">
<xsl:param name="name"/>
<xsl:value-of select="substring-before($name,':')"/>
</xsl:template>
Thanks Richard. Your welcome.
Richard Emberson wrote:
> I have:
>
> WSDL FILE
> <definitions name="urn:Login"
> targetNamespace="http://www.contact.com/Login.wsdl"
> xmlns:mytype="urn:xml-soap-login-demo"
> xmlns:s0="http://www.w3.org/2001/XMLSchema"
> xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
> xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
> xmlns="http://schemas.xmlsoap.org/wsdl/">
>
> ..........
>
> <message name="LoginRequest">
> <part name="version" type="s0:int"/>
> <part name="name" type="s0:string"/>
> <part name="password" type="mytype:string"/>
> </message>
>
> ..........
>
> </definitions>
>
> XSL FILE
> <?xml version="1.0" encoding="UTF-8"?>
> <xsl:stylesheet
> version="1.0"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> xmlns:xalan="http://xml.apache.org/xslt"
> xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
> xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
> >
> ........
> </xsl:stylesheet>
>
> Using pure xslt how can I determine if the 's0' namespaceURI part
> of 's0:int' and 's0:string' "match" the xsd namespace
> (http://www.w3.org/2001/XMLSchema)? Which is to say that
> 's0:int' and 's0:string' are xmlschema base types while 'mytype:string'
> is not.
>
> The namespace-uri() function works only on node-sets.
> The xlts select="/definitions/@*" expression does not include
> any of the xmlns:.. attributes so I can not iterate over them
> searching for the xmlschema namespace urn in the WSDL FILE.
>
> Thanks
>
> Richard Emberson