source: draft-ietf-httpbis/latest/extract-header-defs.xslt @ 290

Last change on this file since 290 was 290, checked in by julian.reschke@…, 11 years ago

Add checking of consistency of auto-generated tables for IANA header registrations (related to #72)

  • Property svn:eol-style set to native
  • Property svn:executable set to *
File size: 1.8 KB
Line 
1<xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
2               xmlns:x="http://purl.org/net/xml2rfc/ext"
3               xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#'
4               version="1.0"
5               exclude-result-prefixes="rdf x"
6>
7
8<xsl:output indent="yes" omit-xml-declaration="yes"/>
9
10<xsl:template match="/">
11  <xsl:variable name="table">
12    <texttable align="left" suppress-title="true" anchor="iana.header.registration.table">
13      <ttcol>Header Field Name</ttcol>
14      <ttcol>Protocol</ttcol>
15      <ttcol>Status</ttcol>
16      <ttcol>Reference</ttcol>
17      <xsl:text>&#10;</xsl:text>
18      <xsl:apply-templates select="//section[iref/@item='Headers']">
19        <xsl:sort select="iref[@item='Headers']/@subitem"/>
20      </xsl:apply-templates>
21    </texttable>
22    <xsl:text>&#10;</xsl:text>
23  </xsl:variable>
24
25  <xsl:comment>AUTOGENERATED FROM extract-header-defs.xslt, do not edit manually</xsl:comment>
26  <xsl:text>&#10;</xsl:text>
27  <xsl:copy-of select="$table"/>
28  <xsl:comment>(END)</xsl:comment>
29  <xsl:text>&#10;</xsl:text>
30 
31    <!-- check against current version -->
32  <xsl:variable name="oldtable" select="//texttable[@anchor='iana.header.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
38</xsl:template>
39
40<xsl:template match="section">
41  <xsl:text>&#10;</xsl:text>
42  <c><xsl:value-of select="iref[@item='Headers']/@subitem"/></c>
43  <c>http</c>
44  <c>
45    <xsl:choose>
46      <xsl:when test="ancestor::middle">standard</xsl:when>
47      <xsl:otherwise>&#160;</xsl:otherwise>
48    </xsl:choose>
49  </c>
50  <c><xref target="{@anchor}"/></c>
51</xsl:template>
52
53</xsl:transform>
Note: See TracBrowser for help on using the repository browser.