home *** CD-ROM | disk | FTP | other *** search
/ Internet Magazine 2003 October / INTERNET108.ISO / pc / software / windows / building / xmlspy / xmlspyentcomplete5.exe / Data1.cab / _8F4DB374F0BA41F7B906EAD6CF36733C < prev    next >
Encoding:
Extensible Markup Language  |  2002-09-04  |  20.3 KB  |  608 lines

  1. <?xml version='1.0'?>
  2. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  3.                 xmlns:doc="http://nwalsh.com/xsl/documentation/1.0"
  4.                 exclude-result-prefixes="doc"
  5.                 version='1.0'>
  6.  
  7. <!-- ============================================================ -->
  8. <!-- label markup -->
  9.  
  10. <doc:mode mode="label.markup" xmlns="">
  11. <refpurpose>Provides access to element labels</refpurpose>
  12. <refdescription>
  13. <para>Processing an element in the
  14. <literal role="mode">label.markup</literal> mode produces the
  15. element label.</para>
  16. <para>Trailing punctuation is not added to the label.
  17. </para>
  18. </refdescription>
  19. </doc:mode>
  20.  
  21. <xsl:template match="*" mode="intralabel.punctuation">
  22.   <xsl:text>.</xsl:text>
  23. </xsl:template>
  24.  
  25. <xsl:template match="*" mode="label.markup">
  26.   <xsl:param name="verbose" select="1"/>
  27.   <xsl:if test="$verbose">
  28.     <xsl:message>
  29.       <xsl:text>Request for label of unexpected element: </xsl:text>
  30.       <xsl:value-of select="name(.)"/>
  31.     </xsl:message>
  32.   </xsl:if>
  33. </xsl:template>
  34.  
  35. <xsl:template match="set|book" mode="label.markup">
  36.   <xsl:if test="@label">
  37.     <xsl:value-of select="@label"/>
  38.   </xsl:if>
  39. </xsl:template>
  40.  
  41. <xsl:template match="part" mode="label.markup">
  42.   <xsl:choose>
  43.     <xsl:when test="@label">
  44.       <xsl:value-of select="@label"/>
  45.     </xsl:when>
  46.     <xsl:when test="$part.autolabel != 0">
  47.       <xsl:number from="book" count="part" format="I"/>
  48.     </xsl:when>
  49.   </xsl:choose>
  50. </xsl:template>
  51.  
  52. <xsl:template match="partintro" mode="label.markup">
  53.   <!-- no label -->
  54. </xsl:template>
  55.  
  56. <xsl:template match="preface" mode="label.markup">
  57.   <xsl:choose>
  58.     <xsl:when test="@label">
  59.       <xsl:value-of select="@label"/>
  60.     </xsl:when>
  61.     <xsl:when test="$preface.autolabel != 0">
  62.       <xsl:choose>
  63.         <xsl:when test="$label.from.part != 0 and ancestor::part">
  64.           <xsl:number from="part" count="preface" format="1" level="any"/>
  65.         </xsl:when>
  66.         <xsl:otherwise>
  67.           <xsl:number from="book" count="preface" format="1" level="any"/>
  68.         </xsl:otherwise>
  69.       </xsl:choose>
  70.     </xsl:when>
  71.   </xsl:choose>
  72. </xsl:template>
  73.  
  74. <xsl:template match="chapter" mode="label.markup">
  75.   <xsl:choose>
  76.     <xsl:when test="@label">
  77.       <xsl:value-of select="@label"/>
  78.     </xsl:when>
  79.     <xsl:when test="$chapter.autolabel != 0">
  80.       <xsl:choose>
  81.         <xsl:when test="$label.from.part != 0 and ancestor::part">
  82.           <xsl:number from="part" count="chapter" format="1" level="any"/>
  83.         </xsl:when>
  84.         <xsl:otherwise>
  85.           <xsl:number from="book" count="chapter" format="1" level="any"/>
  86.         </xsl:otherwise>
  87.       </xsl:choose>
  88.     </xsl:when>
  89.   </xsl:choose>
  90. </xsl:template>
  91.  
  92. <xsl:template match="appendix" mode="label.markup">
  93.   <xsl:choose>
  94.     <xsl:when test="@label">
  95.       <xsl:value-of select="@label"/>
  96.     </xsl:when>
  97.     <xsl:when test="$appendix.autolabel != 0">
  98.       <xsl:choose>
  99.         <xsl:when test="$label.from.part != 0 and ancestor::part">
  100.           <xsl:number from="part" count="appendix" format="A" level="any"/>
  101.         </xsl:when>
  102.         <xsl:otherwise>
  103.           <xsl:number from="book|article"
  104.                       count="appendix" format="A" level="any"/>
  105.         </xsl:otherwise>
  106.       </xsl:choose>
  107.     </xsl:when>
  108.   </xsl:choose>
  109. </xsl:template>
  110.  
  111. <xsl:template match="article" mode="label.markup">
  112.   <xsl:if test="@label">
  113.     <xsl:value-of select="@label"/>
  114.   </xsl:if>
  115. </xsl:template>
  116.  
  117. <xsl:template match="dedication|colophon" mode="label.markup">
  118.   <xsl:if test="@label">
  119.     <xsl:value-of select="@label"/>
  120.   </xsl:if>
  121. </xsl:template>
  122.  
  123. <xsl:template match="reference" mode="label.markup">
  124.   <xsl:choose>
  125.     <xsl:when test="@label">
  126.       <xsl:value-of select="@label"/>
  127.     </xsl:when>
  128.     <xsl:when test="$part.autolabel != 0">
  129.       <xsl:number from="book" count="reference" format="I" level="any"/>
  130.     </xsl:when>
  131.   </xsl:choose>
  132. </xsl:template>
  133.  
  134. <xsl:template match="refentry" mode="label.markup">
  135.   <xsl:if test="@label">
  136.     <xsl:value-of select="@label"/>
  137.   </xsl:if>
  138. </xsl:template>
  139.  
  140. <xsl:template match="section" mode="label.markup">
  141.   <!-- if this is a nested section, label the parent -->
  142.   <xsl:if test="local-name(..) = 'section'">
  143.     <xsl:variable name="parent.section.label">
  144.       <xsl:apply-templates select=".." mode="label.markup"/>
  145.     </xsl:variable>
  146.     <xsl:if test="$parent.section.label != ''">
  147.       <xsl:apply-templates select=".." mode="label.markup"/>
  148.       <xsl:apply-templates select=".." mode="intralabel.punctuation"/>
  149.     </xsl:if>
  150.   </xsl:if>
  151.  
  152.   <!-- if the parent is a component, maybe label that too -->
  153.   <xsl:variable name="parent.is.component">
  154.     <xsl:call-template name="is.component">
  155.       <xsl:with-param name="node" select=".."/>
  156.     </xsl:call-template>
  157.   </xsl:variable>
  158.  
  159.   <!-- does this section get labelled? -->
  160.   <xsl:variable name="label">
  161.     <xsl:call-template name="label.this.section">
  162.       <xsl:with-param name="section" select="."/>
  163.     </xsl:call-template>
  164.   </xsl:variable>
  165.  
  166.   <xsl:if test="$section.label.includes.component.label != 0
  167.                 and $parent.is.component != 0">
  168.     <xsl:variable name="parent.label">
  169.       <xsl:apply-templates select=".." mode="label.markup"/>
  170.     </xsl:variable>
  171.     <xsl:if test="$parent.label != ''">
  172.       <xsl:apply-templates select=".." mode="label.markup"/>
  173.       <xsl:apply-templates select=".." mode="intralabel.punctuation"/>
  174.     </xsl:if>
  175.   </xsl:if>
  176.  
  177. <!--
  178.   <xsl:message>
  179.     <xsl:value-of select="$label"/>, <xsl:number count="section"/>
  180.   </xsl:message>
  181. -->
  182.  
  183.   <xsl:choose>
  184.     <xsl:when test="@label">
  185.       <xsl:value-of select="@label"/>
  186.     </xsl:when>
  187.     <xsl:when test="$label != 0">
  188.       <xsl:number count="section"/>
  189.     </xsl:when>
  190.   </xsl:choose>
  191. </xsl:template>
  192.  
  193. <xsl:template match="sect1" mode="label.markup">
  194.   <!-- if the parent is a component, maybe label that too -->
  195.   <xsl:variable name="parent.is.component">
  196.     <xsl:call-template name="is.component">
  197.       <xsl:with-param name="node" select=".."/>
  198.     </xsl:call-template>
  199.   </xsl:variable>
  200.  
  201.   <xsl:if test="$section.label.includes.component.label != 0
  202.                 and $parent.is.component">
  203.     <xsl:variable name="parent.label">
  204.       <xsl:apply-templates select=".." mode="label.markup"/>
  205.     </xsl:variable>
  206.     <xsl:if test="$parent.label != ''">
  207.       <xsl:apply-templates select=".." mode="label.markup"/>
  208.       <xsl:apply-templates select=".." mode="intralabel.punctuation"/>
  209.     </xsl:if>
  210.   </xsl:if>
  211.  
  212.   <xsl:choose>
  213.     <xsl:when test="@label">
  214.       <xsl:value-of select="@label"/>
  215.     </xsl:when>
  216.     <xsl:when test="$section.autolabel != 0">
  217.       <xsl:number count="sect1"/>
  218.     </xsl:when>
  219.   </xsl:choose>
  220. </xsl:template>
  221.  
  222. <xsl:template match="sect2|sect3|sect4|sect5" mode="label.markup">
  223.   <!-- label the parent -->
  224.   <xsl:variable name="parent.label">
  225.     <xsl:apply-templates select=".." mode="label.markup"/>
  226.   </xsl:variable>
  227.   <xsl:if test="$parent.label != ''">
  228.     <xsl:apply-templates select=".." mode="label.markup"/>
  229.     <xsl:apply-templates select=".." mode="intralabel.punctuation"/>
  230.   </xsl:if>
  231.  
  232.   <xsl:choose>
  233.     <xsl:when test="@label">
  234.       <xsl:value-of select="@label"/>
  235.     </xsl:when>
  236.     <xsl:when test="$section.autolabel != 0">
  237.       <xsl:choose>
  238.         <xsl:when test="local-name(.) = 'sect2'">
  239.       <xsl:number count="sect2"/>
  240.     </xsl:when>
  241.     <xsl:when test="local-name(.) = 'sect3'">
  242.       <xsl:number count="sect3"/>
  243.     </xsl:when>
  244.     <xsl:when test="local-name(.) = 'sect4'">
  245.       <xsl:number count="sect4"/>
  246.     </xsl:when>
  247.     <xsl:when test="local-name(.) = 'sect5'">
  248.       <xsl:number count="sect5"/>
  249.     </xsl:when>
  250.     <xsl:otherwise>
  251.       <xsl:message>label.markup: this can't happen!</xsl:message>
  252.     </xsl:otherwise>
  253.       </xsl:choose>
  254.     </xsl:when>
  255.   </xsl:choose>
  256. </xsl:template>
  257.  
  258. <xsl:template match="bridgehead" mode="label.markup">
  259.   <!-- FIXME: could we do a better job here? -->
  260.   <xsl:variable name="contsec"
  261.                 select="(ancestor::section
  262.                          |ancestor::simplesect
  263.                          |ancestor::sect1
  264.                          |ancestor::sect2
  265.                          |ancestor::sect3
  266.                          |ancestor::sect4
  267.                          |ancestor::sect5
  268.                          |ancestor::refsect1
  269.                          |ancestor::refsect2
  270.                          |ancestor::refsect3
  271.                          |ancestor::chapter
  272.                          |ancestor::appendix
  273.                          |ancestor::preface)[last()]"/>
  274.  
  275.   <xsl:apply-templates select="$contsec" mode="label.markup"/>
  276. </xsl:template>
  277.  
  278. <xsl:template match="refsect1" mode="label.markup">
  279.   <xsl:choose>
  280.     <xsl:when test="@label">
  281.       <xsl:value-of select="@label"/>
  282.     </xsl:when>
  283.     <xsl:when test="$section.autolabel != 0">
  284.       <xsl:number count="refsect1"/>
  285.     </xsl:when>
  286.   </xsl:choose>
  287. </xsl:template>
  288.  
  289. <xsl:template match="refsect2|refsect3" mode="label.markup">
  290.   <!-- label the parent -->
  291.   <xsl:variable name="parent.label">
  292.     <xsl:apply-templates select=".." mode="label.markup"/>
  293.   </xsl:variable>
  294.   <xsl:if test="$parent.label != ''">
  295.     <xsl:apply-templates select=".." mode="label.markup"/>
  296.     <xsl:apply-templates select=".." mode="intralabel.punctuation"/>
  297.   </xsl:if>
  298.  
  299.   <xsl:choose>
  300.     <xsl:when test="@label">
  301.       <xsl:value-of select="@label"/>
  302.     </xsl:when>
  303.     <xsl:when test="$section.autolabel != 0">
  304.       <xsl:choose>
  305.         <xsl:when test="local-name(.) = 'refsect2'">
  306.       <xsl:number count="refsect2"/>
  307.     </xsl:when>
  308.         <xsl:otherwise>
  309.       <xsl:number count="refsect3"/>
  310.     </xsl:otherwise>
  311.       </xsl:choose>
  312.     </xsl:when>
  313.   </xsl:choose>
  314. </xsl:template>
  315.  
  316. <xsl:template match="simplesect" mode="label.markup">
  317.   <!-- if this is a nested section, label the parent -->
  318.   <xsl:if test="local-name(..) = 'section'
  319.                 or local-name(..) = 'sect1'
  320.                 or local-name(..) = 'sect2'
  321.                 or local-name(..) = 'sect3'
  322.                 or local-name(..) = 'sect4'
  323.                 or local-name(..) = 'sect5'">
  324.     <xsl:variable name="parent.section.label">
  325.       <xsl:apply-templates select=".." mode="label.markup"/>
  326.     </xsl:variable>
  327.     <xsl:if test="$parent.section.label != ''">
  328.       <xsl:apply-templates select=".." mode="label.markup"/>
  329.       <xsl:apply-templates select=".." mode="intralabel.punctuation"/>
  330.     </xsl:if>
  331.   </xsl:if>
  332.  
  333.   <!-- if the parent is a component, maybe label that too -->
  334.   <xsl:variable name="parent.is.component">
  335.     <xsl:call-template name="is.component">
  336.       <xsl:with-param name="node" select=".."/>
  337.     </xsl:call-template>
  338.   </xsl:variable>
  339.  
  340.   <!-- does this section get labelled? -->
  341.   <xsl:variable name="label">
  342.     <xsl:call-template name="label.this.section">
  343.       <xsl:with-param name="section" select="."/>
  344.     </xsl:call-template>
  345.   </xsl:variable>
  346.  
  347.   <xsl:if test="$section.label.includes.component.label != 0
  348.                 and $parent.is.component != 0">
  349.     <xsl:variable name="parent.label">
  350.       <xsl:apply-templates select=".." mode="label.markup"/>
  351.     </xsl:variable>
  352.     <xsl:if test="$parent.label != ''">
  353.       <xsl:apply-templates select=".." mode="label.markup"/>
  354.       <xsl:apply-templates select=".." mode="intralabel.punctuation"/>
  355.     </xsl:if>
  356.   </xsl:if>
  357.  
  358.   <xsl:choose>
  359.     <xsl:when test="@label">
  360.       <xsl:value-of select="@label"/>
  361.     </xsl:when>
  362.     <xsl:when test="$label != 0">
  363.       <xsl:number count="simplesect"/>
  364.     </xsl:when>
  365.   </xsl:choose>
  366. </xsl:template>
  367.  
  368. <xsl:template match="qandadiv" mode="label.markup">
  369.   <xsl:variable name="lparent" select="(ancestor::set
  370.                                        |ancestor::book
  371.                                        |ancestor::chapter
  372.                                        |ancestor::appendix
  373.                                        |ancestor::preface
  374.                                        |ancestor::section
  375.                                        |ancestor::simplesect
  376.                                        |ancestor::sect1
  377.                                        |ancestor::sect2
  378.                                        |ancestor::sect3
  379.                                        |ancestor::sect4
  380.                                        |ancestor::sect5
  381.                                        |ancestor::refsect1
  382.                                        |ancestor::refsect2
  383.                                        |ancestor::refsect3)[last()]"/>
  384.  
  385.   <xsl:variable name="lparent.prefix">
  386.     <xsl:apply-templates select="$lparent" mode="label.markup"/>
  387.   </xsl:variable>
  388.  
  389.   <xsl:variable name="prefix">
  390.     <xsl:if test="$qanda.inherit.numeration != 0">
  391.       <xsl:if test="$lparent.prefix != ''">
  392.         <xsl:apply-templates select="$lparent" mode="label.markup"/>
  393.         <xsl:apply-templates select="$lparent" mode="intralabel.punctuation"/>
  394.       </xsl:if>
  395.     </xsl:if>
  396.   </xsl:variable>
  397.  
  398.   <xsl:choose>
  399.     <xsl:when test="@label">
  400.       <xsl:value-of select="$prefix"/>
  401.       <xsl:value-of select="@label"/>
  402.     </xsl:when>
  403.     <xsl:when test="$qandadiv.autolabel != 0">
  404.       <xsl:value-of select="$prefix"/>
  405.       <xsl:number level="multiple" count="qandadiv" format="1"/>
  406.     </xsl:when>
  407.   </xsl:choose>
  408. </xsl:template>
  409.  
  410. <xsl:template match="question|answer" mode="label.markup">
  411.   <xsl:variable name="lparent" select="(ancestor::set
  412.                                        |ancestor::book
  413.                                        |ancestor::chapter
  414.                                        |ancestor::appendix
  415.                                        |ancestor::preface
  416.                                        |ancestor::section
  417.                                        |ancestor::simplesect
  418.                                        |ancestor::sect1
  419.                                        |ancestor::sect2
  420.                                        |ancestor::sect3
  421.                                        |ancestor::sect4
  422.                                        |ancestor::sect5
  423.                                        |ancestor::refsect1
  424.                                        |ancestor::refsect2
  425.                                        |ancestor::refsect3)[last()]"/>
  426.  
  427.   <xsl:variable name="lparent.prefix">
  428.     <xsl:apply-templates select="$lparent" mode="label.markup"/>
  429.   </xsl:variable>
  430.  
  431.   <xsl:variable name="prefix">
  432.     <xsl:if test="$qanda.inherit.numeration != 0">
  433.       <xsl:if test="$lparent.prefix != ''">
  434.         <xsl:apply-templates select="$lparent" mode="label.markup"/>
  435.         <xsl:apply-templates select="$lparent" mode="intralabel.punctuation"/>
  436.       </xsl:if>
  437.       <xsl:if test="ancestor::qandadiv">
  438.         <xsl:apply-templates select="ancestor::qandadiv[1]" mode="label.markup"/>
  439.         <xsl:apply-templates select="ancestor::qandadiv[1]"
  440.                              mode="intralabel.punctuation"/>
  441.       </xsl:if>
  442.     </xsl:if>
  443.   </xsl:variable>
  444.  
  445.   <xsl:variable name="inhlabel"
  446.                 select="ancestor-or-self::qandaset/@defaultlabel[1]"/>
  447.  
  448.   <xsl:variable name="deflabel">
  449.     <xsl:choose>
  450.       <xsl:when test="$inhlabel != ''">
  451.         <xsl:value-of select="$inhlabel"/>
  452.       </xsl:when>
  453.       <xsl:otherwise>
  454.         <xsl:value-of select="$qanda.defaultlabel"/>
  455.       </xsl:otherwise>
  456.     </xsl:choose>
  457.   </xsl:variable>
  458.  
  459.   <xsl:variable name="label" select="label"/>
  460.  
  461.   <xsl:choose>
  462.     <xsl:when test="count($label)>0">
  463.       <xsl:apply-templates select="$label"/>
  464.     </xsl:when>
  465.  
  466.     <xsl:when test="$deflabel = 'qanda' and local-name(.) = 'question'">
  467.       <xsl:call-template name="gentext">
  468.         <xsl:with-param name="key" select="'Question'"/>
  469.       </xsl:call-template>
  470.     </xsl:when>
  471.  
  472.     <xsl:when test="$deflabel = 'qanda' and local-name(.) = 'answer'">
  473.       <xsl:call-template name="gentext">
  474.         <xsl:with-param name="key" select="'Answer'"/>
  475.       </xsl:call-template>
  476.     </xsl:when>
  477.  
  478.     <xsl:when test="$deflabel = 'number' and local-name(.) = 'question'">
  479.       <xsl:value-of select="$prefix"/>
  480.       <xsl:number level="multiple" count="qandaentry" format="1"/>
  481.     </xsl:when>
  482.   </xsl:choose>
  483. </xsl:template>
  484.  
  485. <xsl:template match="bibliography|glossary|index" mode="label.markup">
  486.   <xsl:if test="@label">
  487.     <xsl:value-of select="@label"/>
  488.   </xsl:if>
  489. </xsl:template>
  490.  
  491. <xsl:template match="figure|table|example|procedure" mode="label.markup">
  492.   <xsl:variable name="pchap"
  493.                 select="ancestor::chapter
  494.                         |ancestor::appendix
  495.                         |ancestor::article[ancestor::book]"/>
  496.  
  497.   <xsl:variable name="prefix">
  498.     <xsl:if test="count($pchap) > 0">
  499.       <xsl:apply-templates select="$pchap" mode="label.markup"/>
  500.     </xsl:if>
  501.   </xsl:variable>
  502.  
  503.   <xsl:choose>
  504.     <xsl:when test="@label">
  505.       <xsl:value-of select="@label"/>
  506.     </xsl:when>
  507.     <xsl:otherwise>
  508.       <xsl:choose>
  509.         <xsl:when test="count($pchap)>0">
  510.           <xsl:if test="$prefix != ''">
  511.             <xsl:apply-templates select="$pchap" mode="label.markup"/>
  512.             <xsl:apply-templates select="$pchap" mode="intralabel.punctuation"/>
  513.           </xsl:if>
  514.           <xsl:number format="1" from="chapter|appendix" level="any"/>
  515.         </xsl:when>
  516.         <xsl:otherwise>
  517.           <xsl:number format="1" from="book|article" level="any"/>
  518.         </xsl:otherwise>
  519.       </xsl:choose>
  520.     </xsl:otherwise>
  521.   </xsl:choose>
  522. </xsl:template>
  523.  
  524. <xsl:template match="equation" mode="label.markup">
  525.   <xsl:variable name="pchap"
  526.                 select="ancestor::chapter
  527.                         |ancestor::appendix
  528.                         |ancestor::article[ancestor::book]"/>
  529.  
  530.   <xsl:variable name="prefix">
  531.     <xsl:if test="count($pchap) > 0">
  532.       <xsl:apply-templates select="$pchap" mode="label.markup"/>
  533.     </xsl:if>
  534.   </xsl:variable>
  535.  
  536.   <xsl:choose>
  537.     <xsl:when test="@label">
  538.       <xsl:value-of select="@label"/>
  539.     </xsl:when>
  540.     <xsl:otherwise>
  541.       <xsl:choose>
  542.         <xsl:when test="count($pchap)>0">
  543.           <xsl:if test="$prefix != ''">
  544.             <xsl:apply-templates select="$pchap" mode="label.markup"/>
  545.             <xsl:apply-templates select="$pchap" mode="intralabel.punctuation"/>
  546.           </xsl:if>
  547.           <xsl:number format="1" count="equation[title]" from="chapter|appendix" level="any"/>
  548.         </xsl:when>
  549.         <xsl:otherwise>
  550.           <xsl:number format="1" count="equation[title]" from="book|article" level="any"/>
  551.         </xsl:otherwise>
  552.       </xsl:choose>
  553.     </xsl:otherwise>
  554.   </xsl:choose>
  555. </xsl:template>
  556.  
  557. <xsl:template match="orderedlist/listitem" mode="label.markup">
  558.   <xsl:variable name="numeration">
  559.     <xsl:call-template name="list.numeration">
  560.       <xsl:with-param name="node" select="parent::orderedlist"/>
  561.     </xsl:call-template>
  562.   </xsl:variable>
  563.  
  564.   <xsl:variable name="type">
  565.     <xsl:choose>
  566.       <xsl:when test="$numeration='arabic'">1</xsl:when>
  567.       <xsl:when test="$numeration='loweralpha'">a</xsl:when>
  568.       <xsl:when test="$numeration='lowerroman'">i</xsl:when>
  569.       <xsl:when test="$numeration='upperalpha'">A</xsl:when>
  570.       <xsl:when test="$numeration='upperroman'">I</xsl:when>
  571.       <!-- What!? This should never happen -->
  572.       <xsl:otherwise>
  573.         <xsl:message>
  574.           <xsl:text>Unexpected numeration: </xsl:text>
  575.           <xsl:value-of select="$numeration"/>
  576.         </xsl:message>
  577.         <xsl:value-of select="1."/>
  578.       </xsl:otherwise>
  579.     </xsl:choose>
  580.   </xsl:variable>
  581.  
  582.   <xsl:number count="listitem" format="{$type}"/>
  583. </xsl:template>
  584.  
  585. <xsl:template match="abstract" mode="label.markup">
  586.   <!-- nop -->
  587. </xsl:template>
  588.  
  589. <!-- ============================================================ -->
  590.  
  591. <xsl:template name="label.this.section">
  592.   <xsl:param name="section" select="."/>
  593.   <xsl:value-of select="$section.autolabel"/>
  594. </xsl:template>
  595.  
  596. <doc:template name="label.this.section" xmlns="">
  597. <refpurpose>Returns true if $section should be labelled</refpurpose>
  598. <refdescription>
  599. <para>Returns true if the specified section should be labelled.
  600. By default, this template simply returns $section.autolabel, but
  601. custom stylesheets may override it to get more selective behavior.</para>
  602. </refdescription>
  603. </doc:template>
  604.  
  605. <!-- ============================================================ -->
  606.  
  607. </xsl:stylesheet>
  608.