This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: XSL and Namespaces
> <Schema xmlns="urn:schemas-microsoft-com:xml-data"
that is the element with local name Schema in the namespace
urn:schemas-microsoft-com:xml-data
> <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'
xmlns:xsl='http://www.w3.org/1999/XSL/Transform'
xmlns:xd="urn:schemas-microsoft-com:xml-data">
<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.
David
(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
http://www.star.net.uk/stats.asp
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list