[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>
|
---|
[1728] | 15 | <ttcol>Idempotent</ttcol>
|
---|
[288] | 16 | <ttcol>Reference</ttcol>
|
---|
[1898] | 17 | <xsl:apply-templates select="//section[iref[contains(@item,' method') and @primary='true']]">
|
---|
| 18 | <xsl:sort select="iref[contains(@item,' method') and @primary='true']/@item"/>
|
---|
[288] | 19 | </xsl:apply-templates>
|
---|
| 20 | </texttable>
|
---|
| 21 | <xsl:text> </xsl:text>
|
---|
| 22 | </xsl:variable>
|
---|
| 23 |
|
---|
[270] | 24 | <xsl:comment>AUTOGENERATED FROM extract-method-defs.xslt, do not edit manually</xsl:comment>
|
---|
| 25 | <xsl:text> </xsl:text>
|
---|
[288] | 26 | <xsl:copy-of select="$table"/>
|
---|
| 27 | <xsl:comment>(END)</xsl:comment>
|
---|
[270] | 28 | <xsl:text> </xsl:text>
|
---|
[288] | 29 |
|
---|
| 30 | <!-- check against current version -->
|
---|
| 31 | <xsl:variable name="oldtable" select="//texttable[@anchor='iana.method.registration.table']" />
|
---|
| 32 |
|
---|
[292] | 33 | <xsl:variable name="s">
|
---|
| 34 | <xsl:apply-templates select="$table//texttable" mode="tostring"/>
|
---|
| 35 | </xsl:variable>
|
---|
| 36 |
|
---|
| 37 | <xsl:variable name="s1">
|
---|
| 38 | <xsl:apply-templates select="$oldtable" mode="tostring"/>
|
---|
| 39 | </xsl:variable>
|
---|
| 40 |
|
---|
| 41 | <xsl:if test="$s != $s1">
|
---|
| 42 | <xsl:message>WARNING: table contained inside source document needs to be updated</xsl:message>
|
---|
| 43 | <xsl:message><xsl:value-of select="$s"/></xsl:message>
|
---|
| 44 | <xsl:message><xsl:value-of select="$s1"/></xsl:message>
|
---|
[288] | 45 | </xsl:if>
|
---|
| 46 |
|
---|
[270] | 47 | </xsl:template>
|
---|
| 48 |
|
---|
[292] | 49 | <xsl:template match="*" mode="tostring">
|
---|
| 50 | <xsl:text><</xsl:text>
|
---|
| 51 | <xsl:value-of select="name()"/>
|
---|
| 52 | <xsl:for-each select="@*">
|
---|
| 53 | <xsl:sort select="name()"/>
|
---|
| 54 | <xsl:text> </xsl:text>
|
---|
| 55 | <xsl:value-of select="name()"/>
|
---|
| 56 | <xsl:text>=</xsl:text>
|
---|
| 57 | <xsl:value-of select="."/>
|
---|
| 58 | </xsl:for-each>
|
---|
| 59 | <xsl:text>></xsl:text>
|
---|
| 60 |
|
---|
| 61 | <xsl:apply-templates select="node()" mode="tostring"/>
|
---|
| 62 |
|
---|
| 63 | <xsl:text></</xsl:text>
|
---|
| 64 | <xsl:value-of select="name()"/>
|
---|
| 65 | <xsl:text>></xsl:text>
|
---|
| 66 |
|
---|
| 67 | </xsl:template>
|
---|
| 68 |
|
---|
| 69 | <xsl:template match="text()" mode="tostring">
|
---|
| 70 | <xsl:value-of select="."/>
|
---|
| 71 | </xsl:template>
|
---|
| 72 |
|
---|
| 73 | <xsl:template match="texttable/text()" mode="tostring"/>
|
---|
| 74 | <xsl:template match="texttable/c[xref]/text()" mode="tostring"/>
|
---|
| 75 |
|
---|
[270] | 76 | <xsl:template match="section">
|
---|
[1898] | 77 | <xsl:variable name="t" select="iref[contains(@item,' method')]/@item"/>
|
---|
| 78 | <xsl:variable name="text" select="substring-before($t,' method')"/>
|
---|
[286] | 79 |
|
---|
| 80 | <xsl:variable name="safe" xmlns:p2="urn:ietf:id:draft-ietf-httpbis-p2-semantics#">
|
---|
| 81 | <xsl:choose>
|
---|
| 82 | <xsl:when test="rdf:Description/p2:safe='yes'">yes</xsl:when>
|
---|
| 83 | <xsl:otherwise>no</xsl:otherwise>
|
---|
| 84 | </xsl:choose>
|
---|
| 85 | </xsl:variable>
|
---|
| 86 |
|
---|
[1728] | 87 | <xsl:variable name="idempotent" xmlns:p2="urn:ietf:id:draft-ietf-httpbis-p2-semantics#">
|
---|
| 88 | <xsl:choose>
|
---|
| 89 | <xsl:when test="rdf:Description/p2:idempotent='yes'">yes</xsl:when>
|
---|
| 90 | <xsl:otherwise>no</xsl:otherwise>
|
---|
| 91 | </xsl:choose>
|
---|
| 92 | </xsl:variable>
|
---|
| 93 |
|
---|
[270] | 94 | <xsl:text> </xsl:text>
|
---|
| 95 | <c><xsl:value-of select="$text"/></c>
|
---|
[286] | 96 | <c><xsl:value-of select="$safe"/></c>
|
---|
[1728] | 97 | <c><xsl:value-of select="$idempotent"/></c>
|
---|
[270] | 98 | <c><xref target="{@anchor}"/></c>
|
---|
| 99 | </xsl:template>
|
---|
| 100 |
|
---|
[1557] | 101 | </xsl:transform>
|
---|