Re: [xsl] XSL and Namespaces

Subject: Re: [xsl] XSL and Namespaces
From: David Carlisle <davidc@xxxxxxxxx>
Date: Thu, 8 Mar 2001 15:07:01 GMT
> <Schema xmlns="urn:schemas-microsoft-com:xml-data"

that is the element with local name Schema in the namespace

> 	<xsl:template match="/Schema">
That matches an element with local name Schema in the null namespace,
which isn't the same thing at all.

You want:

<xsl:stylesheet version='1.0'

	<xsl:template match="/xd:Schema">

>     <xsl:attribute name="xmlns">
> 				<xsl:value-of select="@xmlns" />

No you can not generate namespace declarations with xsl:attribute.
In any case you do not want to as the xsl:copy copies the element
name (which includes the namespace name) and so a Namespace declaration
for the namespace will be added automatically.

Same for all your other xsl:attribute commands.

(This is a FAQ)

This message has been checked for all known viruses by Star Internet delivered
through the MessageLabs Virus Control Centre. For further information visit

 XSL-List info and archive:

Current Thread