Ignore:
Timestamp:
Nov 22, 2008, 11:02:04 AM (11 years ago)
Author:
julian.reschke@…
Message:

ABNF appendix: group by first letter, add internal links to definitions -- fix group detection (related to #36)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • draft-ietf-httpbis/latest/abnf2xml2rfc.xslt

    r427 r428  
    2424          <xsl:variable name="lineno" select="position()"/>
    2525          <xsl:variable name="sc1" select="substring(.,1,1)"/>
    26           <xsl:variable name="sc0" select="substring($lines[$lineno - 1],1,1)"/>
     26          <xsl:variable name="sc0" select="x:laststartchar($lines, $lineno - 1)"/>
    2727          <xsl:if test="$sc1!=' ' and $sc0!=' ' and $sc1!=$sc0">
    2828            <xsl:text>&#10;</xsl:text>
     
    6161  </xsl:if>
    6262</xsl:template>
     63
     64<xsl:function name="x:laststartchar">
     65  <xsl:param name="lines"/>
     66  <xsl:param name="position"/>
     67 
     68  <xsl:choose>
     69    <xsl:when test="' '!=substring($lines[$position],1,1)">
     70      <xsl:value-of select="substring($lines[$position],1,1)"/>
     71    </xsl:when>
     72    <xsl:otherwise>
     73      <xsl:value-of select="x:laststartchar($lines, $position - 1)"/>
     74    </xsl:otherwise>
     75  </xsl:choose>
     76</xsl:function>
    6377 
    6478 
Note: See TracChangeset for help on using the changeset viewer.