[270] | 1 | <xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
---|
| 2 | xmlns:x="http://purl.org/net/xml2rfc/ext"
|
---|
[286] | 3 | xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#'
|
---|
[270] | 4 | version="1.0"
|
---|
[288] | 5 | exclude-result-prefixes="rdf x"
|
---|
[270] | 6 | >
|
---|
| 7 |
|
---|
| 8 | <xsl:output indent="yes" omit-xml-declaration="yes"/>
|
---|
| 9 |
|
---|
| 10 | <xsl:template match="/">
|
---|
[288] | 11 | <xsl:variable name="table">
|
---|
| 12 | <texttable align="left" suppress-title="true" anchor="iana.method.registration.table">
|
---|
| 13 | <ttcol>Method</ttcol>
|
---|
| 14 | <ttcol>Safe</ttcol>
|
---|
| 15 | <ttcol>Reference</ttcol>
|
---|
| 16 | <xsl:apply-templates select="//section[iref/@item='Methods']">
|
---|
| 17 | <xsl:sort select="iref[@item='Methods']/@subitem"/>
|
---|
| 18 | </xsl:apply-templates>
|
---|
| 19 | </texttable>
|
---|
| 20 | <xsl:text> </xsl:text>
|
---|
| 21 | </xsl:variable>
|
---|
| 22 |
|
---|
[270] | 23 | <xsl:comment>AUTOGENERATED FROM extract-method-defs.xslt, do not edit manually</xsl:comment>
|
---|
| 24 | <xsl:text> </xsl:text>
|
---|
[288] | 25 | <xsl:copy-of select="$table"/>
|
---|
| 26 | <xsl:comment>(END)</xsl:comment>
|
---|
[270] | 27 | <xsl:text> </xsl:text>
|
---|
[288] | 28 |
|
---|
| 29 | <!-- check against current version -->
|
---|
| 30 | <xsl:variable name="oldtable" select="//texttable[@anchor='iana.method.registration.table']" />
|
---|
| 31 |
|
---|
[292] | 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>
|
---|
[288] | 44 | </xsl:if>
|
---|
| 45 |
|
---|
[270] | 46 | </xsl:template>
|
---|
| 47 |
|
---|
[292] | 48 | <xsl:template match="*" mode="tostring">
|
---|
| 49 | <xsl:text><</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>></xsl:text>
|
---|
| 59 |
|
---|
| 60 | <xsl:apply-templates select="node()" mode="tostring"/>
|
---|
| 61 |
|
---|
| 62 | <xsl:text></</xsl:text>
|
---|
| 63 | <xsl:value-of select="name()"/>
|
---|
| 64 | <xsl:text>></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"/>
|
---|
| 74 |
|
---|
[270] | 75 | <xsl:template match="section">
|
---|
[286] | 76 |
|
---|
[270] | 77 | <xsl:variable name="text" select="iref[@item='Methods']/@subitem"/>
|
---|
[286] | 78 |
|
---|
| 79 | <xsl:variable name="safe" xmlns:p2="urn:ietf:id:draft-ietf-httpbis-p2-semantics#">
|
---|
| 80 | <xsl:choose>
|
---|
| 81 | <xsl:when test="rdf:Description/p2:safe='yes'">yes</xsl:when>
|
---|
| 82 | <xsl:otherwise>no</xsl:otherwise>
|
---|
| 83 | </xsl:choose>
|
---|
| 84 | </xsl:variable>
|
---|
| 85 |
|
---|
[270] | 86 | <xsl:text> </xsl:text>
|
---|
| 87 | <c><xsl:value-of select="$text"/></c>
|
---|
[286] | 88 | <c><xsl:value-of select="$safe"/></c>
|
---|
[270] | 89 | <c><xref target="{@anchor}"/></c>
|
---|
| 90 | </xsl:template>
|
---|
| 91 |
|
---|
| 92 | </xsl:transform> |
---|