[253] | 1 | <xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform" |
---|
[290] | 2 | xmlns:x="http://purl.org/net/xml2rfc/ext" |
---|
| 3 | xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#' |
---|
[253] | 4 | version="1.0" |
---|
[290] | 5 | exclude-result-prefixes="rdf x" |
---|
[253] | 6 | > |
---|
| 7 | |
---|
[290] | 8 | <xsl:output indent="yes" omit-xml-declaration="yes"/> |
---|
[253] | 9 | |
---|
| 10 | <xsl:template match="/"> |
---|
[290] | 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> </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> </xsl:text> |
---|
| 23 | </xsl:variable> |
---|
| 24 | |
---|
[253] | 25 | <xsl:comment>AUTOGENERATED FROM extract-header-defs.xslt, do not edit manually</xsl:comment> |
---|
| 26 | <xsl:text> </xsl:text> |
---|
[290] | 27 | <xsl:copy-of select="$table"/> |
---|
| 28 | <xsl:comment>(END)</xsl:comment> |
---|
[253] | 29 | <xsl:text> </xsl:text> |
---|
[290] | 30 | |
---|
[291] | 31 | <!-- check against current version --> |
---|
[290] | 32 | <xsl:variable name="oldtable" select="//texttable[@anchor='iana.header.registration.table']" /> |
---|
| 33 | |
---|
[291] | 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> |
---|
[290] | 46 | </xsl:if> |
---|
| 47 | |
---|
[253] | 48 | </xsl:template> |
---|
| 49 | |
---|
[291] | 50 | <xsl:template match="*" mode="tostring"> |
---|
| 51 | <xsl:text><</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>></xsl:text> |
---|
| 61 | |
---|
| 62 | <xsl:apply-templates select="node()" mode="tostring"/> |
---|
| 63 | |
---|
| 64 | <xsl:text></</xsl:text> |
---|
| 65 | <xsl:value-of select="name()"/> |
---|
| 66 | <xsl:text>></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"/> |
---|
| 76 | |
---|
[253] | 77 | <xsl:template match="section"> |
---|
| 78 | <xsl:text> </xsl:text> |
---|
| 79 | <c><xsl:value-of select="iref[@item='Headers']/@subitem"/></c> |
---|
| 80 | <c>http</c> |
---|
[939] | 81 | <c>standard</c> |
---|
[253] | 82 | <c><xref target="{@anchor}"/></c> |
---|
| 83 | </xsl:template> |
---|
| 84 | |
---|
| 85 | </xsl:transform> |
---|