Use the exlude-result-prefixes attribute on xsl:stylesheet:
<?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:foo="http://www.foo.com/foo/"
exclude-result-prefixes="foo">
...
Dave
Guillaume
L�onard To: "Xalan-C-Users"
<[email protected]>
<[EMAIL PROTECTED] cc: (bcc: David N
Bertoni/Cambridge/IBM)
um.net> Subject: mxlns problem
05/10/2002 10:29
AM
I have an XML document containing a reference to a namespace
<?xml version="1.0" encoding="ISO-8859-1"?>
<foo:doc xmlns:foo="http://www.foo.com/foo/">
<foo:row NUM="0">Data0</foo:row>
<foo:row NUM="1">Data1</foo:row>
<foo:row NUM="2">Data2</foo:row>
<foo:row NUM="3">Data3</foo:row>
</foo:doc>
and an XSL stylesheet that transforms this document into wml
<?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:foo="http://www.foo.com/foo/">
<xsl:output method="xml" indent="no" encoding="ISO-8859-1"/>
<xsl:template match="/">
<wml>
<card id="main" title="An exemple">
<p><xsl:apply-templates
select=".//foo:row"/></p>
</card>
</wml>
</xsl:template>
<xsl:template match="foo:row">
<anchor>
<xsl:variable name="myvar">
<xsl:value-of select="."/>
</xsl:variable>
<xsl:value-of select="."/>
<go href="{$myvar}.wml"/>
</anchor>
<br/>
</xsl:template>
</xsl:stylesheet>
Xalan C++ version 1.3 (and the previous ones also) reporduce the
"xmlns:foo="http://www.foo.com/foo/"" in the first tag of the resulting
document. This means that this document does not conform to the WML dtd.
Is there a way to disable this feature so that the namespace necessary to
perform the transformation are not transferred to the resulting documents?
thnx