Changeset 292


Ignore:
Timestamp:
Jul 19, 2008, 6:16:42 AM (11 years ago)
Author:
julian.reschke@…
Message:

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

Location:
draft-ietf-httpbis/latest
Files:
2 edited

Legend:

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

    r288 r292  
    3030  <xsl:variable name="oldtable" select="//texttable[@anchor='iana.method.registration.table']" />
    3131
    32   <xsl:if test="string($table//ttcol | $table//c) != string($oldtable//ttcol | $oldtable//c)">
    33     <xsl:message>WARNING: table contained inside source document needs to be updated!</xsl:message>
     32  <xsl:variable name="s">
     33    <xsl:apply-templates select="$table//texttable" mode="tostring"/>
     34  </xsl:variable>
     35 
     36  <xsl:variable name="s1">
     37    <xsl:apply-templates select="$oldtable" mode="tostring"/>
     38  </xsl:variable>
     39
     40  <xsl:if test="$s != $s1">
     41    <xsl:message>WARNING: table contained inside source document needs to be updated</xsl:message>
     42    <xsl:message><xsl:value-of select="$s"/></xsl:message>
     43    <xsl:message><xsl:value-of select="$s1"/></xsl:message>
    3444  </xsl:if>
    3545 
    3646</xsl:template>
     47
     48<xsl:template match="*" mode="tostring">
     49  <xsl:text>&lt;</xsl:text>
     50  <xsl:value-of select="name()"/>
     51  <xsl:for-each select="@*">
     52    <xsl:sort select="name()"/>
     53    <xsl:text> </xsl:text>
     54    <xsl:value-of select="name()"/>
     55    <xsl:text>=</xsl:text>
     56    <xsl:value-of select="."/>
     57  </xsl:for-each>
     58  <xsl:text>&gt;</xsl:text>
     59 
     60  <xsl:apply-templates select="node()" mode="tostring"/>
     61 
     62  <xsl:text>&lt;/</xsl:text>
     63  <xsl:value-of select="name()"/>
     64  <xsl:text>&gt;</xsl:text>
     65
     66</xsl:template>
     67
     68<xsl:template match="text()" mode="tostring">
     69  <xsl:value-of select="."/>
     70</xsl:template>
     71
     72<xsl:template match="texttable/text()" mode="tostring"/>
     73<xsl:template match="texttable/c[xref]/text()" mode="tostring"/>
    3774
    3875<xsl:template match="section">
  • draft-ietf-httpbis/latest/extract-status-code-defs.xslt

    r288 r292  
    3232  <xsl:variable name="oldtable" select="//texttable[@anchor='iana.status.code.registration.table']" />
    3333
    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>
     34  <xsl:variable name="s">
     35    <xsl:apply-templates select="$table//texttable" mode="tostring"/>
     36  </xsl:variable>
     37 
     38  <xsl:variable name="s1">
     39    <xsl:apply-templates select="$oldtable" mode="tostring"/>
     40  </xsl:variable>
     41
     42  <xsl:if test="$s != $s1">
     43    <xsl:message>WARNING: table contained inside source document needs to be updated</xsl:message>
     44    <xsl:message><xsl:value-of select="$s"/></xsl:message>
     45    <xsl:message><xsl:value-of select="$s1"/></xsl:message>
    3646  </xsl:if>
    3747
    3848</xsl:template>
     49
     50<xsl:template match="*" mode="tostring">
     51  <xsl:text>&lt;</xsl:text>
     52  <xsl:value-of select="name()"/>
     53  <xsl:for-each select="@*">
     54    <xsl:sort select="name()"/>
     55    <xsl:text> </xsl:text>
     56    <xsl:value-of select="name()"/>
     57    <xsl:text>=</xsl:text>
     58    <xsl:value-of select="."/>
     59  </xsl:for-each>
     60  <xsl:text>&gt;</xsl:text>
     61 
     62  <xsl:apply-templates select="node()" mode="tostring"/>
     63 
     64  <xsl:text>&lt;/</xsl:text>
     65  <xsl:value-of select="name()"/>
     66  <xsl:text>&gt;</xsl:text>
     67
     68</xsl:template>
     69
     70<xsl:template match="text()" mode="tostring">
     71  <xsl:value-of select="."/>
     72</xsl:template>
     73
     74<xsl:template match="texttable/text()" mode="tostring"/>
     75<xsl:template match="texttable/c[xref]/text()" mode="tostring"/>
    3976
    4077<xsl:template match="section">
Note: See TracChangeset for help on using the changeset viewer.