RE: [xsl] Transferring xmlns aliases to result tree.

Subject: RE: [xsl] Transferring xmlns aliases to result tree.
From: "Tom Rybak" <trybak@xxxxxxx>
Date: Fri, 6 Jun 2003 12:38:36 -0400
Sure, here's the definition.

<wsdl:definitions targetNamespace="http://someurl/"; xmlns="http://schemas.xmlsoap.org/wsdl/"; xmlns:impl="http://someurl/";>

So, the problem is that someType is defined within the WSDL document as

<complexType name="someType">
</complexType>

so it ends up being defined in targetNamespace, which is equivalent to the impl namespace. This type is later used by the line I gave before.

<element name="someElement" type="impl:someType"/>

and is referred to as impl:someType. What I meant when I said "appears as text" is that "impl" is only used withing the txt value of the type attribute. It's never explicitly used in the name of an element or the name of an attribute. Hence, it is never evaluated by the xslt engine, and the namespace alias is not copied into the result tree.

I have tried the following.

<xsl:for-each select="namespace::*">
	<xsl:copy/>
</xsl:for-each>

But, it does not work very well, since the attribute will be copied over as 'impl="http://someurl/";' and not as 'xmlns:impl="http://someurl/";'.

-----Original Message-----
From: Lars Huttar [mailto:lars_huttar@xxxxxxx]
Sent: Friday, June 06, 2003 12:40 AM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: RE: [xsl] Transferring xmlns aliases to result tree.


> I am having trouble transferring the xml namespace aliases 
> from a source tree to the result tree. Specifically I would 
> like to transfer some aliases that are used only within the 
> value of an attribute.
> 
> <element name="someElement" type="impl:someType"/>
> 
> I have a mapping at the top of the document for impl, but 
> it's not used anywhere else except the type attribute. Is 
> there a way to force this mapping to appear in the result 
> tree? It does not seem to be transferred. I assume it's 
> because it appears as text.

What do you mean, it appears as text?

Can you show us your declaration of the "impl" prefix
at the top of the document?

Lars


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


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


Current Thread