Re: [xsl] CATCH ALL | template rule (2nd try)

Subject: Re: [xsl] CATCH ALL | template rule (2nd try)
From: Karl Stubsjoen <kstubs@xxxxxxxxx>
Date: Tue, 17 May 2005 13:54:31 -0700
Okay, I am going to try that!  How about this simpler example
though..., would you mind providing the inverse for this one:

<xsl:template match="A">
 <xsl:copy>
  <match>
    <xsl:apply-templates select="B[X[@val=$match_v1]][X[@val=$match_v2]]"/>
  </match>
  <exception>
    <!-- currently, copy of the match above, but would like this to be
expressed as the exception -->
    <xsl:apply-templates select="B[X[@val=$match_v1]][X[@val=$match_v2]]"/>
  </exception>
</xsl:copy>
</xsl:template>


On 5/17/05, Dimitre Novatchev <dnovatchev@xxxxxxxxx> wrote:
> > <xsl:apply-templates
> >
select="fx:node-set($interval)//fn:interval[//field[@fieldname='EntityID']=$F
TEInterval_Members][//field[@fieldname='EntityID']=$FTEInterval_JTED_Mains]"
> > mode="Exceptions" />
> >
> > What is the inverse of this?  Which would suffice to be my "CATCH
> > ALL", in otherwords match everything else where the above combination
> > fails.
>
> fx:node-set($interval)//node()[not(count(. | yourExpression) =
> count(yourExpression))]
>
> generally, if there are two node-sets: $ns1 and $ns2, their set difference
>    $ns2 - $ns1
> is expressed by this XPath expression:
>
>    $ns2[not(count(. | $ns1) = count($ns1) ) ]
>
> Cheers,
> Dimitre

Current Thread