P
Philipp Lenssen
My friend has the following problem (background: we want to transform
XML to XHTML via XSLT):
"We copy XHTML fragments into an output by using the following template:
<xsl:template match="*" mode="xhtml">
<xsl:element name="{local-name()}">
<xsl:copy-of select="@*"/>
<xsl:apply-templates mode="xhtml"/>
</xsl:element>
</xsl:template>
Using this template, closed elements (like <br/>) will now appear as
opened (like <br></br>). This isn't quite XHTML-like.
Now we can't copy the XHTML using <xsl:copy-of> even though that would
solve the open-tag problem. That's because the XHTML root element
declares a specific namespace, say "xy".
Now even when we try to suppress the namespace declaration or avoid
copying the particular element, the transformation process will keep
the xmlns attribute, because the copied XML belongs to the document
containing the XY namespace declaration."
All help appreciated!
XML to XHTML via XSLT):
"We copy XHTML fragments into an output by using the following template:
<xsl:template match="*" mode="xhtml">
<xsl:element name="{local-name()}">
<xsl:copy-of select="@*"/>
<xsl:apply-templates mode="xhtml"/>
</xsl:element>
</xsl:template>
Using this template, closed elements (like <br/>) will now appear as
opened (like <br></br>). This isn't quite XHTML-like.
Now we can't copy the XHTML using <xsl:copy-of> even though that would
solve the open-tag problem. That's because the XHTML root element
declares a specific namespace, say "xy".
Now even when we try to suppress the namespace declaration or avoid
copying the particular element, the transformation process will keep
the xmlns attribute, because the copied XML belongs to the document
containing the XY namespace declaration."
All help appreciated!