Except sequences

<?xml version="1.0"?> 
<xsl:stylesheet version="2.0" 
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

  <xsl:output indent="yes"/>             
                
  <xsl:template match="/">
    <numbers>
      <xsl:for-each select='(3 to 10) except (5 to 12)'>
        <integer>
          <xsl:value-of select="."/>
        </integer>
      </xsl:for-each>
    </numbers>
  </xsl:template>

</xsl:stylesheet>

Output:

<numbers>
  <integer>3</integer>
  <integer>4</integer>
</numbers>

Previous | Next | Top | Cafe con Leche

Copyright 2002 Elliotte Rusty Harold
elharo@metalab.unc.edu
Last Modified February 18, 2002