[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: Set difference in xsl:number/@count, xsl:key/@matc

Subject: RE: Set difference in xsl:number/@count, xsl:key/@match
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Wed, 21 Mar 2007 22:39:12 -0000
RE:  Set difference in xsl:number/@count
> I sort 
> of want to say
>   <xsl:number count="*[contains(@class, ' figure ')]
>               except *[contains(@class, ' flowchart ')]"/> 
> only set difference doesn't work in xsl:number/@count, even 
> in XSLT 2.0. 
> Besides, the base processing can't necessarily know about 
> flowcharts, circuitdiagrams, familytrees, or however many 
> specializations of "figure"
> I've included.  Each specialization has to have its own 
> processing XSLT.

I think I would use

<xsl:number count="*[my:is-class-figure(.)]"/>

where the function my:class-figure is defined in the base stylesheet as

<xsl:function name="my:is-class-figure">  
  <xsl:param name="node" as="element()"/>
  <xsl:sequence select="contains($node/@class, ' figure ')"/>
</xsl:function>

and is redefined in your customization layer as:

<xsl:function name="my:is-class-figure">
  <xsl:param name="node" as="element()"/>
  <xsl:sequence select="contains($node/@class, ' figure ') and
not(contains(@class, ' flowchart '))"/>
</xsl:function>

Michael Kay
http://www.saxonica.com/

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.