Ignore:
Timestamp:
18/07/08 10:37:21 (12 years ago)
Author:
julian.reschke@…
Message:

Upgrade to latest version of rfc2629.xslt

File:
1 edited

Legend:

Unmodified
Added
Removed
  • rfc2629xslt/check-references.xslt

    r272 r285  
    3333
    3434<xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    35                 version="1.0"
     35                version="2.0"
    3636                xmlns:ed="http://greenbytes.de/2002/rfcedit"
    3737                xmlns:rfced="http://www.rfc-editor.org/rfc-index"
     
    4141
    4242<xsl:param name="intended-level" />
     43<xsl:param name="link-check" />
    4344
    4445<xsl:template match="/">
    4546  <xsl:if test="$intended-level!='' and ($intended-level!='PROPOSED' and $intended-level!='DRAFT' and $intended-level!='STANDARD')">
    46     <xsl:message terminate='yes'>UNKNOWN INTENDED STATUS (must be 'PROPOSED', 'DRAFT' or 'STANDARD')!</xsl:message>
     47    <xsl:message terminate='yes'>intended-level: unsupported value (must be 'PROPOSED', 'DRAFT' or 'STANDARD')!</xsl:message>
    4748  </xsl:if>
    4849 
     50  <xsl:if test="$link-check!='' and ($link-check!='no' and $link-check!='yes')">
     51    <xsl:message terminate='yes'>link-check: unsupported value (must be 'yes' or 'no')!</xsl:message>
     52  </xsl:if>
     53
    4954  <xsl:for-each select="//references">
    5055    <xsl:variable name="title">
     
    6368    <xsl:for-each select=".//reference[not(ancestor::ed:del)]">
    6469      <xsl:sort select="@anchor"/>
     70     
    6571      <xsl:choose>
    6672        <xsl:when test="seriesInfo/@name='RFC'">
     
    8086    </xsl:for-each>
    8187  </xsl:for-each>
     88
     89  <xsl:variable name="targets2" select="//eref/@target | //reference/@target"/>
     90  <xsl:variable name="targets" select="$targets2[starts-with(.,'http')]"/>
     91  <xsl:if test="$targets and $link-check='yes'">
     92    <xsl:text>&#10;Link Targets&#10;</xsl:text>
     93    <xsl:choose>
     94      <xsl:when test="function-available('unparsed-text-available')">
     95        <xsl:for-each select="$targets">
     96          <xsl:variable name="t">
     97            <xsl:choose>
     98              <xsl:when test="contains(.,'#')"><xsl:value-of select="substring-before(.,'#')"/></xsl:when>
     99              <xsl:otherwise><xsl:value-of select="."/></xsl:otherwise>
     100            </xsl:choose>
     101          </xsl:variable>
     102       
     103          <xsl:text>&lt;</xsl:text>
     104          <xsl:value-of select="$t"/>
     105          <xsl:text>&gt;: </xsl:text>
     106          <xsl:choose>
     107            <xsl:when test="unparsed-text-available($t)">ok</xsl:when>
     108            <xsl:otherwise>NOT AVAILABLE AS TEXT</xsl:otherwise>
     109          </xsl:choose>
     110          <xsl:text>&#10;</xsl:text>
     111        </xsl:for-each>
     112      </xsl:when>
     113      <xsl:otherwise>
     114        <xsl:text>not checked (requires XSLT 2.0)</xsl:text>
     115      </xsl:otherwise>
     116    </xsl:choose>
     117  </xsl:if>
     118 
    82119</xsl:template>
    83120
     
    146183      <xsl:text>-- intended standards level of </xsl:text>
    147184      <xsl:value-of select="$intended-level"/>
    148       <xsl:text> incompatible with this document's standard level!</xsl:text>
     185      <xsl:text> incompatible with this document's standard level</xsl:text>
     186      <xsl:if test="annotation//xref[@target='BCP97']">
     187        <xsl:text> (...but a downref annotation referencing BCP 97 seems to be present)</xsl:text>
     188      </xsl:if>
     189      <xsl:text>!</xsl:text>
    149190    </xsl:when>
    150191    <xsl:otherwise>ok</xsl:otherwise>
Note: See TracChangeset for help on using the changeset viewer.