home *** CD-ROM | disk | FTP | other *** search
/ PC Online 1999 November / PCONLINE_11_99.ISO / filesbbs / OS2 / APCHSSL2.ZIP / OS2HTTPD / public / htdocs / xml / test10.xsl < prev    next >
Encoding:
Extensible Markup Language  |  1999-02-08  |  2.2 KB  |  73 lines

  1. <?xml version="1.0"?> 
  2.  
  3. <!-- Test for numbering -->
  4. <xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl">
  5.  
  6.   <!-- Root template - start processing here -->
  7.   <xsl:template match="/">
  8.     <HTML>
  9.       <HEAD>
  10.         <META http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
  11.         <META http-equiv="Expires" content="0"/>
  12.       </HEAD>
  13.       <BODY>
  14.             <xsl:apply-templates/>
  15.       </BODY>
  16.     </HTML>
  17.   </xsl:template>
  18.       
  19.     <xsl:template match="doc">
  20.       <H1>Test for xsl:number</H1>
  21.       <xsl:apply-templates/>
  22.     </xsl:template>
  23.  
  24.     <xsl:template match="title" priority="-1">
  25.       <P>
  26.          (any(a): count="title" <xsl:number level="any"
  27.                      count="title"
  28.                      from="title"
  29.                      format="A. "/>)
  30.          (any(b) - count="chapter|section|subsection": <xsl:number level="any"
  31.                      count="chapter|section|subsection"
  32.                      from="chapter|section|subsection"
  33.                      format="A. "/>)
  34.          <xsl:apply-templates/>
  35.       </P>
  36.     </xsl:template>
  37.       
  38.     <xsl:template match="chapter//title">
  39.       <P>
  40.          (single(c): <xsl:number level="single"
  41.                      count="chapter|section|subsection"
  42.                      from="chapter|section|subsection"
  43.                      format="1."/>) 
  44.          (multi(d): <xsl:number level="multi"
  45.                      count="chapter|section|subsection"
  46.                      from="chapter|section|subsection"
  47.                      format="1.1."/>) 
  48.          (any(e): <xsl:number level="any"
  49.                      count="title"
  50.                      format="A. "/>)
  51.          <xsl:apply-templates/>
  52.       </P>
  53.     </xsl:template>
  54.  
  55.     <xsl:template match="xappendix//title">
  56.       <P>
  57.          (single(f): <xsl:number level="single"
  58.                      count="appendix|section|subsection"
  59.                      from="appendix|section|subsection"
  60.                      format="1."/>) 
  61.          (multi(g): <xsl:number level="multi"
  62.                      count="appendix|section|subsection"
  63.                      from="appendix|section|subsection"
  64.                      format="A.1.I. "/>) 
  65.          (any(h): <xsl:number level="any"
  66.                      count="title"
  67.                      from="title"
  68.                      format="A. "/>)
  69.          <xsl:apply-templates/>
  70.       </P>
  71.     </xsl:template>
  72.    
  73. </xsl:stylesheet>