Ignore:
Timestamp:
02/06/10 07:50:07 (13 years ago)
Author:
julian.reschke@…
Message:

Add RFC 5861 cache directives to IANA instructions (see #208)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • draft-ietf-httpbis/latest/extract-cache-directives.xslt

    r815 r825  
    33               xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#'
    44               version="1.0"
     5               xmlns:my="#my"
    56               exclude-result-prefixes="rdf x"
    67>
    78
    89<xsl:output indent="yes" omit-xml-declaration="yes"/>
     10
     11<my:data>
     12  <my:item>
     13    <iref item='Cache Directives' subitem='stale-while-revalidate'>
     14      <xref target="RFC5861" x:fmt="," x:sec="3"/>
     15    </iref>
     16    <iref item='Cache Directives' subitem='stale-if-error'>
     17      <xref target="RFC5861" x:fmt="," x:sec="4"/>
     18    </iref>
     19  </my:item>
     20</my:data>
    921
    1022<xsl:template match="/">
     
    1426      <ttcol>Reference</ttcol>
    1527      <xsl:text>&#10;</xsl:text>
    16       <xsl:apply-templates select="//iref[@item='Cache Directives']">
     28      <xsl:apply-templates select="//iref[@item='Cache Directives']|document('')//iref[@item='Cache Directives']">
    1729        <xsl:sort select="@subitem"/>
    1830      </xsl:apply-templates>
     
    8092    <c><xsl:value-of select="$dir"/></c>
    8193    <c>
    82       <xsl:for-each select="//*[iref[@item='Cache Directives' and @subitem=$dir]]">
    83         <xsl:if test="position()!=1">
    84           <xsl:text>, </xsl:text>
    85         </xsl:if>
    86         <xref target="{ancestor-or-self::*[@anchor][1]/@anchor}"/>
    87       </xsl:for-each>
     94      <xsl:choose>
     95        <!-- from this XSLT? -->
     96        <xsl:when test="ancestor::my:item">
     97          <xsl:for-each select="xref">
     98            <xsl:if test="position()!=1">
     99              <xsl:text>, </xsl:text>
     100            </xsl:if>
     101            <xref>
     102              <xsl:copy-of select="@*"/>
     103            </xref>
     104          </xsl:for-each>
     105        </xsl:when>
     106        <xsl:otherwise>
     107          <xsl:for-each select="//*[iref[@item='Cache Directives' and @subitem=$dir]]">
     108            <xsl:if test="position()!=1">
     109              <xsl:text>, </xsl:text>
     110            </xsl:if>
     111            <xref target="{ancestor-or-self::*[@anchor][1]/@anchor}"/>
     112          </xsl:for-each>
     113        </xsl:otherwise>
     114      </xsl:choose>
    88115    </c>
    89 
     116   
    90117  </xsl:if>
    91118</xsl:template>
Note: See TracChangeset for help on using the changeset viewer.