[Home] [By Thread] [By Date] [Recent Entries]
Hi Stefan,
The easy way out here is to add the filter to the matching template instruction, and add another matching template for those that don't match, or, if all "item" elements need to be processed in the same way, but item with property=x need to be processed with an extra instruction, something like this should work: <xsl:template match="items">
<xsl:apply-templates select="item" />
</xsl:template><!-- called ONLY when property X is true -->
<xsl:template match="item[property='x']">
<myItem>
<xsl:value-of select="index"/>
</myItem>
</xsl:template><!-- called for all other situations (may leave empty if you don't want to process them) -->
<xsl:template match="item">
<otherItem>
<xsl:value-of select="index"/>
</otherItem>
</xsl:template>I have to note that I found your instruction a tad confusing, so if I misunderstood, please try to clarify with a simplified input/output example of XML. Kind regards, Abel Braaksma On 6-6-2011 17:56, Stefan Hunziker wrote: Hi I have the following problem: Given an xml like the following:
|

Cart



