xsl-list
[Top] [All Lists]

Re: [xsl] Using variables to get the complement of a node set

2012-02-10 05:42:56
On 10/02/2012 11:31, ihe onwuka wrote:
Suppose the children of the context node are elements named A to Z.

Then I declare a variable

<xsl:variable name="alpha" select="A|B|C|D"/>

Now i want to match on the complement of alpha.

Can I say

it would have been quicker just to try, but...

<xsl:template match="* except $alpha"/>
no that would be a legal xpath but not a pattern

or
<xsl:template match="*[not $alpha]"/>

no, that's a syntax error so wouldn't run at all

easiest is

<xsl:template match="*"> the complement

<xsl:template match="A|B|C|D" priority="2"> this one

David


________________________________________________________________________
The Numerical Algorithms Group Ltd is a company registered in England
and Wales with company number 1249803. The registered office is:
Wilkinson House, Jordan Hill Road, Oxford OX2 8DR, United Kingdom.

This e-mail has been scanned for all viruses by Star. The service is
powered by MessageLabs. ________________________________________________________________________

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>