Re: [xsl] combination of copy-of and apply-templates

Subject: Re: [xsl] combination of copy-of and apply-templates
From: Florent Georges <darkman_spam@xxxxxxxx>
Date: Wed, 22 Nov 2006 14:49:59 +0100 (CET)
Nico Van Cleemput wrote:

> Nevermind, I already found what I was doing wrong:

>      <xsl:template match="myhtml">
>          <xsl:apply-templates select="child::node()"/>
>      </xsl:template>

  Yes, you got it.  xsl:copy does a shallow copy of the context node
(it is like a deep copy, but for the elements an empty element of the
same name is created).  So if you don't want to copy the node, don't
use xsl:copy.

  child:: is the default axis, so in general child::node() is simply
written as node().  Matter of taste.

>      <xsl:template match="//mytag">
>          blabla
>      </xsl:template>

  The descendant axis is not required at the beginning of a pattern. 
It sounds more like obfuscation, I think.  match="mytag" does the same




Dicouvrez une nouvelle fagon d'obtenir des riponses ` toutes vos questions ! 
Profitez des connaissances, des opinions et des expiriences des internautes sur Yahoo! Questions/Riponses

Current Thread