M
Mike Dickens
hi,
i'm sure this has come up before but havn't managed to find an answer.
if i have the following xslt
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet method="xml" version="1.0" xmlns:ns1="abc"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xslutput indent="yes" media-type="text/xml" standalone="yes"
version="1.0"/>
<xsl:template match="/">
<x>
<xsl:element name="y" namespace="abc">
<xsl:apply-templates select="/a"/>
</xsl:element>
</x>
</xsl:template>
<xsl:template match="/a">
<z>
<xsl:value-of select="b"/>
</z>
</xsl:template>
</xsl:stylesheet>
and apply it to the following xml
<a>
<b>hello</b>
</a>
i get
<?xml version="1.0" standalone="yes"?>
<x xmlns:ns1="abc">
<y xmlns="abc">
<z xmlns="">hello</z>
</y>
</x>
my question is this. is it possible to remove the xmlns="" bit without
having to use <ns1:z> in the xslt?
thanks,
mike
i'm sure this has come up before but havn't managed to find an answer.
if i have the following xslt
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet method="xml" version="1.0" xmlns:ns1="abc"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xslutput indent="yes" media-type="text/xml" standalone="yes"
version="1.0"/>
<xsl:template match="/">
<x>
<xsl:element name="y" namespace="abc">
<xsl:apply-templates select="/a"/>
</xsl:element>
</x>
</xsl:template>
<xsl:template match="/a">
<z>
<xsl:value-of select="b"/>
</z>
</xsl:template>
</xsl:stylesheet>
and apply it to the following xml
<a>
<b>hello</b>
</a>
i get
<?xml version="1.0" standalone="yes"?>
<x xmlns:ns1="abc">
<y xmlns="abc">
<z xmlns="">hello</z>
</y>
</x>
my question is this. is it possible to remove the xmlns="" bit without
having to use <ns1:z> in the xslt?
thanks,
mike