Subject: Re: [xsl] deep copy without attributes From: "G. Ken Holman" <gkholman@xxxxxxxxxxxxxxxxxxxx> Date: Mon, 20 May 2013 09:20:49 -0400 |
I have done this
<xsl:template match="*"> <pattern id="{@*[1]}"> <xsl:copy> <xsl:apply-templates mode="no-attributes"/> </xsl:copy> </pattern> </xsl:template>
<xsl:template match="*" mode="no-attributes"> <xsl:copy> <xsl:apply-templates mode="no-attributes"/> </xsl:copy> </xsl:template>
which seems cumbersome when what I really want to do is
<xsl:template match="*"> <pattern id="{@*[1]}"> <xsl:copy-of select="node() except @*"/> </pattern> </xsl:template>
idea being to deep copy leaving the attribute nodes behind although that syntax will not do that.
<xsl:template match="*"> <pattern id="{@*[1]}"> <xsl:apply-templates select="." mode="no-attributes"/> </pattern> </xsl:template>
-- Contact us for world-wide XML consulting and instructor-led training | Free 5-hour lecture: http://www.CraneSoftwrights.com/links/udemy.htm | Crane Softwrights Ltd. http://www.CraneSoftwrights.com/s/ | G. Ken Holman mailto:gkholman@xxxxxxxxxxxxxxxxxxxx | Google+ profile: https://plus.google.com/116832879756988317389/about | Legal business disclaimers: http://www.CraneSoftwrights.com/legal |
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] deep copy without attributes, Ihe Onwuka | Thread | Re: [xsl] deep copy without attribu, Ihe Onwuka |
[xsl] deep copy without attributes, Ihe Onwuka | Date | Re: [xsl] deep copy without attribu, Ihe Onwuka |
Month |