Ignore:
Timestamp:
Jul 19, 2008, 2:30:39 AM (11 years ago)
Author:
julian.reschke@…
Message:

Add checking of consistency of auto-generated tables (related to #72)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • draft-ietf-httpbis/latest/extract-status-code-defs.xslt

    r262 r288  
    11<xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    22               xmlns:x="http://purl.org/net/xml2rfc/ext"
     3               xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#'
    34               version="1.0"
     5               exclude-result-prefixes="rdf x"
    46>
    57
    68<xsl:output indent="yes" omit-xml-declaration="yes"/>
    79
     10<xsl:output indent="yes" omit-xml-declaration="yes"/>
     11
    812<xsl:template match="/">
     13  <xsl:variable name="table">
     14    <texttable align="left" suppress-title="true" anchor="iana.status.code.registration.table">
     15      <ttcol>Value</ttcol>
     16      <ttcol>Description</ttcol>
     17      <ttcol>Reference</ttcol>
     18      <xsl:apply-templates select="//section[iref/@item='Status Codes']">
     19        <xsl:sort select="iref[@item='Status Codes']/@subitem"/>
     20      </xsl:apply-templates>
     21    </texttable>
     22    <xsl:text>&#10;</xsl:text>
     23  </xsl:variable>
     24
    925  <xsl:comment>AUTOGENERATED FROM extract-status-code-defs.xslt, do not edit manually</xsl:comment>
    1026  <xsl:text>&#10;</xsl:text>
    11   <xsl:comment>(START)</xsl:comment>
     27  <xsl:copy-of select="$table"/>
     28  <xsl:comment>(END)</xsl:comment>
    1229  <xsl:text>&#10;</xsl:text>
    13   <t>
    14     The HTTP Status Code Registry located at <eref target="http://www.iana.org/assignments/http-status-codes"/>
    15     should be updated with the registrations below:
    16   </t>
    17   <texttable>
    18     <ttcol>Value</ttcol>
    19     <ttcol>Description</ttcol>
    20     <ttcol>Reference</ttcol>
    21     <xsl:apply-templates select="//section[iref/@item='Status Codes']">
    22       <xsl:sort select="iref[@item='Status Codes']/@subitem"/>
    23     </xsl:apply-templates>
    24   </texttable>
    25   <t>
    26   </t>
    27   <xsl:text>&#10;</xsl:text>
    28   <xsl:comment>(END)</xsl:comment>
     30
     31  <!-- check against current version -->
     32  <xsl:variable name="oldtable" select="//texttable[@anchor='iana.status.code.registration.table']" />
     33
     34  <xsl:if test="string($table//ttcol | $table//c) != string($oldtable//ttcol | $oldtable//c)">
     35    <xsl:message>WARNING: table contained inside source document needs to be updated!</xsl:message>
     36  </xsl:if>
     37
    2938</xsl:template>
    3039
Note: See TracChangeset for help on using the changeset viewer.