[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

[xsl] Excluding an element with specific content from an call


Subject: [xsl] Excluding an element with specific content from an <xsl:sort> call
From: "Mark Wilson" <mark@xxxxxxxxxxxx>
Date: Sat, 30 Jan 2010 12:04:53 -0800

Hi,
Is it possible when using <xsl:sort> to exclude elements with specific content from that <xsl:sort>call?


In Listing 1, when the content of the element<Prefix> is 'A' , I would like to exclude that particular element from being sorted in the <xsl:sort select="Prefix" data-type="text" /> call. I cannot see how to use the "except" operator to do this. Is there a way to use "except" or some other filter?

Some input records will contain no <Prefix> element. However, when present, the <Prefix> element may content other than "A", such as "D", "L", etc. My goal is to sort input records with an <Prefix>A</Prefix> element as though it were absent from the record.

Listing 1:
<xsl:for-each-group select="Item" group-by="concat(CatalogName, Prefix, CatalogNumber, Range)">
<xsl:sort select="CatalogName" data-type="text" collation="{$sorting-collation}"/>
<xsl:sort select="Prefix" data-type="text" />
<xsl:sort select="CatalogNumber" data-type="number"/>


Thanks,
Mark



Current Thread