Subject: Re: [xsl] Replace content of element, then transform it... From: Martin Honnen <Martin.Honnen@xxxxxx> Date: Thu, 30 Aug 2012 13:26:00 +0200 |
So I tried this
<xsl:template match="body"> <body> <xsl:value-of select="." disable-output-escaping="yes"/> </body> </xsl:template>
<xsl:template match="leadtext"> <leadtext> <xsl:value-of select="." disable-output-escaping="yes"/> </leadtext> </xsl:template>
<xsl:template match="node()|@*"> <xsl:variable name="foo"> <xsl:copy> <xsl:apply-templates select="node()|@*"/> </xsl:copy> </xsl:variable> <xsl:apply-templates select="$foo" mode="phase2" /> </xsl:template> <!-- Error message: Description: Cannot create an attribute node (id) whose parent is a documen= t node -->
After reading about how this works, I now understand why I am getting the e= rror. Is there another alternative to make this possible in one document, o= r do I have to send the output to a new document?
<xsl:template match="/"> <xsl:variable name="foo"> <xsl:apply-templates/> </xsl:variable> <xsl:apply-templates select="$foo/node()" mode="phase2"/> </xsl:template>
Martin Honnen --- MVP Data Platform Development http://msmvps.com/blogs/martin_honnen/
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] Replace content of element, t, trond.huso | Thread | RE: [xsl] Replace content of elemen, trond.huso |
[xsl] Replace content of element, t, trond.huso | Date | Re: [xsl] Replace content of elemen, Michael Kay |
Month |