Subject: Re: [xsl] Copy part of the file if some conditions are applied From: Jeni Tennison <jeni@xxxxxxxxxxxxxxxx> Date: Thu, 08 Jun 2006 20:47:32 +0100 |
I want to copy some parts of the tree, under certains conditions, for example:
<xsl:template match="node()|@*"> <xsl:copy> <xsl:apply-templates select="@*|node()" /> </xsl:copy> </xsl:template>
If <pred> in <tagB> contains the caracter 'z' then nothing should be copy from the <tagA> (and that <tagA> should not appear in the transformation).
Otherwise, I have to check if any <pred> tag inside <tagC> contains 'z', in that case, I cannot copy anyhing from the father tag (D or E).
Is important to mention that in case I have just one
<tagD> inside <tagC>, and that <tagD> contains 'z',
nothing including <tagA> should be copied.
<xsl:template match="tagA[count(tagC/tagD) = 1 and contains(tagC/tagD/pred, 'z')]" />
Jeni -- Jeni Tennison http://www.jenitennison.com
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] Copy part of the file if some, brigadasinter@xxxxxx | Thread | [xsl] Save value in variable or par, Niklas Holmberg |
Re: [xsl] Using PIs to set attribut, Wendell Piez | Date | RE: [xsl] Using PIs to set attribut, Steven Anderson |
Month |