This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
XSL and Namespaces
- To: "Xsl-List (E-mail)" <XSL-List at lists dot mulberrytech dot com>
- Subject: [xsl] XSL and Namespaces
- From: "Borca, Olivier" <Olivier dot Borca at softplumbers dot com>
- Date: Thu, 8 Mar 2001 15:44:37 +0100
- Reply-To: xsl-list at lists dot mulberrytech dot com
- Thread-Index: AcCn3kyfR3DRczb/TUK1OP8vORhLEw==
- Thread-Topic: XSL and Namespaces
Hi,
I have the following problem using XSLT to transform and xdr file to
another via xsl (xdr is an xml file).
- This is the source file :
<?xml version="1.0" ?>
<Schema xmlns="urn:schemas-microsoft-com:xml-data"
xmlns:dt="urn:schemas-microsoft-com:datatypes"
xmlns:sql="urn:schemas-microsoft-com:xml-sql">
</Schema>
- This is the XSL file:
<xsl:stylesheet version='1.0'
xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>
<xsl:template match="/Schema">
<xsl:copy>
<xsl:attribute name="xmlns">
<xsl:value-of select="@xmlns" />
</xsl:attribute>
<xsl:attribute name="xmlns:dt">
<xsl:value-of select="@xmlns:dt" />
</xsl:attribute>
<xsl:attribute name="xmlns:sql">
<xsl:value-of select="@xmlns:sql" />
</xsl:attribute>
<xsl:apply-templates />
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
- Applying the XSL to the xdr file, i have the following result (select
the text after this line to see that space characters are created):
<?xml version="1.0" encoding="UTF-8"?>
- If I remove the namespaces from the source file:
<?xml version="1.0" ?>
<Schema>
</Schema>
- I have the following result:
<?xml version="1.0" encoding="UTF-8"?>
<Schema xmlns:dt="" xmlns:sql="">
</Schema>
So, as you can see, when I remove the namespaces, the XSL works.
Does anyone see where the problem comes from ?
Thx a lot,
Olivier
--------------------------------------------------
Olivier Borca
SoftPlumbers Engineer (Geneva)
Tel: (+4122) 8491003
E-Mail: olivier.borca@softplumbers.com
--------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list