xsl-list
[Top] [All Lists]

RE: [xsl] Set difference in xsl:number/@count, xsl:key/@match

2007-03-21 16:10:29
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/


--~------------------------------------------------------------------
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>
--~--