|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: xsl templates, Removing spurious namespace declara
I have a solution which seems to work for a simple copy:
<xsl:template name="recurseCopy">
<xsl:choose>
<xsl:when test="local-name()=''">
<xsl:copy/>
</xsl:when>
<xsl:otherwise>
<xsl:element name="{local-name()}" namespace="">
<xsl:for-each select="@*">
<xsl:attribute name="{local-name()}">
<xsl:value-of select="current()"/>
</xsl:attribute>
</xsl:for-each>
<xsl:for-each select="node()">
<xsl:call-template name="recurseCopy"/>
</xsl:for-each>
</xsl:element>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="Point|Attribute">
<xsl:call-template name="recurseCopy"/>
</xsl:template>
but if anyone can see any simplifications or problems with this, that would
be useful! The <xsl:when> bit is needed for copying text nodes.
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








