Ignore:
Timestamp:
Dec 11, 2007, 3:32:16 PM (12 years ago)
Author:
julian.reschke@…
Message:

rfc2629.xslt fix: for cross-document references, distinguish between Section and Appendix

File:
1 edited

Legend:

Unmodified
Added
Removed
  • rfc2629xslt/clean-for-DTD.xslt

    r30 r32  
    184184<xsl:template match="xref[@x:* and not(node())]" mode="cleanup">
    185185  <xsl:variable name="node" select="$src//*[@anchor=current()/@target]" />
     186
    186187  <xsl:variable name="sec">
    187188    <xsl:choose>
     
    198199  </xsl:variable>
    199200
     201  <xsl:variable name="secterm">
     202    <xsl:choose>
     203      <!-- starts with letter? -->
     204      <xsl:when test="translate(substring($sec,1,1),$ucase,'')=''">Appendix</xsl:when>
     205      <xsl:otherwise>Section</xsl:otherwise>
     206    </xsl:choose>
     207  </xsl:variable>
     208
    200209  <xsl:variable name="fmt">
    201210    <xsl:choose>
     
    211220        <xsl:apply-templates select="@target|@format|@pageno|text()|*" mode="cleanup"/>
    212221      </xref>
    213       <xsl:text>, Section </xsl:text>
     222      <xsl:text>, </xsl:text>
     223      <xsl:value-of select="$secterm"/>
     224      <xsl:text> </xsl:text>
    214225      <xsl:value-of select="$sec"/>
    215226    </xsl:when>
    216227    <xsl:when test="$fmt='sec'">
    217       <xsl:text>Section </xsl:text>
     228      <xsl:value-of select="$secterm"/>
     229      <xsl:text> </xsl:text>
    218230      <xsl:value-of select="$sec"/>
    219231    </xsl:when>
     
    225237        <xsl:apply-templates select="@target|@format|@pageno|text()|*" mode="cleanup"/>
    226238      </xref>
    227       <xsl:text> (Section </xsl:text>
     239      <xsl:text> (</xsl:text>
     240      <xsl:value-of select="$secterm"/>
     241      <xsl:text> </xsl:text>
    228242      <xsl:value-of select="$sec"/>
    229243      <xsl:text>)</xsl:text>
    230244    </xsl:when>
    231245    <xsl:when test="$fmt='of'">
    232       <xsl:text>Section </xsl:text>
     246      <xsl:value-of select="$secterm"/>
     247      <xsl:text> </xsl:text>
    233248      <xsl:value-of select="$sec"/>
    234249      <xsl:text> of </xsl:text>
Note: See TracChangeset for help on using the changeset viewer.