cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrius Sabanas <an...@taide.lt>
Subject Re: how to copy...
Date Thu, 13 Jul 2000 15:09:41 GMT
Hans-Guenter Stein wrote:
> 
> How to make a deep copy of a node without copying the node itself (but
> copying its value)?
> 
> i.e.:
> 
> input:
> <mynode>This is <i>very</i>important</mynode>
> 
> should result in output:
> This is <i>very</i>important


Hi,

try something like this:

<xsl:template match="mynode">
 <xsl:apply-templates select="*|@*|comment()|text()"/>
</xsl:template>

<xsl:template match="mynode//*|@*|mynode//text()">
 <xsl:copy>
  <xsl:apply-templates select="*|@*|comment()|text()"/>
 </xsl:copy>
</xsl:template>

Maybe there is a more effective way, I don't know :-)


-- 
Andrius Sabanas
mailto:andsh@taide.lt
http://metclub.node.lt

Mime
View raw message