Ignore:
Timestamp:
02/07/12 12:17:58 (8 years ago)
Author:
julian.reschke@…
Message:

bump up document dates and update to latest version of rfc2629.xslt

File:
1 edited

Legend:

Unmodified
Added
Removed
  • rfc2629xslt/samples/rfc2629.xslt

    r1667 r1699  
    15241524      <xsl:value-of select="concat($bib/x:source/@basename,'.',$outputExtension,$ref/@x:rel)" />
    15251525    </xsl:when>
     1526    <xsl:when test="$ref and $bib/x:source/@href and $bib/x:source/@basename and $ref/@anchor">
     1527      <xsl:value-of select="concat($bib/x:source/@basename,'.',$outputExtension,'#',$ref/@anchor)" />
     1528    </xsl:when>
    15261529    <!-- tools.ietf.org won't have the "-latest" draft -->
    15271530    <xsl:when test="$bib/seriesInfo/@name='Internet-Draft' and $bib/x:source/@href and $bib/x:source/@basename and substring($bib/x:source/@basename, (string-length($bib/x:source/@basename) - string-length('-latest')) + 1)='-latest'">
    15281531      <xsl:value-of select="concat($bib/x:source/@basename,'.',$outputExtension)" />
    15291532    </xsl:when>
     1533    <!-- TODO: this should handle the case where there's one BCP entry but
     1534    multiple RFC entries in a more useful way-->
    15301535    <xsl:when test="$bib/seriesInfo/@name='RFC'">
     1536      <xsl:variable name="rfcEntries" select="$bib/seriesInfo[@name='RFC']"/>
     1537      <xsl:if test="count($rfcEntries)!=1">
     1538        <xsl:call-template name="warning">
     1539          <xsl:with-param name="msg" select="concat('seriesInfo/@name=RFC encountered multiple times for reference ',$bib/@anchor,', will generate link to first entry only')"/>
     1540        </xsl:call-template>
     1541      </xsl:if>
    15311542      <xsl:variable name="sec">
    15321543        <xsl:choose>
     
    15431554        </xsl:choose>
    15441555      </xsl:variable>
    1545       <xsl:value-of select="concat($rfcUrlPrefix,$bib/seriesInfo[@name='RFC']/@value,$rfcUrlPostfix)" />
     1556      <xsl:value-of select="concat($rfcUrlPrefix,$rfcEntries[1]/@value,$rfcUrlPostfix)" />
    15461557      <xsl:if test="$ref and $sec!='' and $rfcUrlFragSection and $rfcUrlFragAppendix">
    15471558        <xsl:choose>
     
    52345245  <xsl:if test="@anchor and @anchor!=''">
    52355246    <!-- check validity of anchor name -->
    5236     <xsl:variable name="test">
    5237       <xsl:element name="{@anchor}"/>
    5238     </xsl:variable>
    5239     <xsl:if test="count(exslt:node-set($test)//*) = 0">
     5247    <xsl:variable name="t" select="@anchor"/>
     5248    <xsl:variable name="tstart" select="substring($t,1,1)"/>
     5249
     5250    <!-- we only check for disallowed ASCII characters for now -->
     5251    <xsl:variable name="not-namestartchars">&#9;&#10;&#13;&#32;!"#$%&amp;'()*+,-./0123456789;&lt;=&gt;?@[\]^`[|}~</xsl:variable>
     5252
     5253    <xsl:if test="$tstart!=translate($tstart,$not-namestartchars,'')">
    52405254      <xsl:call-template name="error">
    5241         <xsl:with-param name="msg" select="concat('&quot;',@anchor,'&quot; is not a valid XML name')"/>
     5255        <xsl:with-param name="msg" select="concat('anchor &quot;',$t,'&quot; can not start with character &quot;',$tstart,'&quot;')"/>
    52425256      </xsl:call-template>
    52435257    </xsl:if>
    5244   </xsl:if>
     5258    <xsl:call-template name="check-anchor-non-start">
     5259      <xsl:with-param name="f" select="$t"/>
     5260      <xsl:with-param name="t" select="$t"/>
     5261    </xsl:call-template>
     5262  </xsl:if>
     5263</xsl:template>
     5264
     5265<xsl:template name="check-anchor-non-start">
     5266  <xsl:param name="f"/>
     5267  <xsl:param name="t"/>
     5268
     5269  <xsl:variable name="not-namechars">&#9;&#10;&#13;&#32;!"#$%&amp;'()*+,/;&lt;=&gt;?@[\]^`[|}~</xsl:variable>
     5270
     5271  <xsl:choose>
     5272    <xsl:when test="$t=''">
     5273      <!-- Done -->
     5274    </xsl:when>
     5275    <xsl:otherwise>
     5276      <xsl:variable name="s" select="substring($t,1,1)"/>
     5277      <xsl:choose>
     5278        <xsl:when test="$s!=translate($s,$not-namechars,'')">
     5279          <xsl:call-template name="error">
     5280            <xsl:with-param name="msg" select="concat('anchor &quot;',$f,'&quot; contains invalid character &quot;',$s,'&quot; at position ',string-length($f) - string-length($t))"/>
     5281          </xsl:call-template>
     5282        </xsl:when>
     5283        <xsl:otherwise>
     5284          <xsl:call-template name="check-anchor-non-start">
     5285            <xsl:with-param name="f" select="$f"/>
     5286            <xsl:with-param name="t" select="substring($t,2)"/>
     5287          </xsl:call-template>
     5288        </xsl:otherwise>
     5289      </xsl:choose>
     5290    </xsl:otherwise>
     5291  </xsl:choose>
    52455292</xsl:template>
    52465293
     
    52865333
    52875334<xsl:template match="x:ref">
    5288   <xsl:variable name="val" select="."/>
    5289 <!--  <xsl:variable name="target" select="//*[(@anchor and x:anchor-alias/@value=$val) or (@anchor and ed:replace/ed:ins/x:anchor-alias/@value=$val) or (@anchor=$val)]"/> -->
    5290   <xsl:variable name="target" select="key('anchor-item',$val) | key('anchor-item-alias',$val)"/>
     5335  <xsl:variable name="val" select="normalize-space(.)"/>
     5336  <xsl:variable name="target" select="key('anchor-item',$val) | key('anchor-item-alias',$val) | //reference/x:source[x:defines=$val]"/>
    52915337  <xsl:variable name="irefs" select="//iref[@x:for-anchor=$val]"/>
     5338  <xsl:if test="count($target)>1">
     5339    <xsl:call-template name="warning">
     5340      <xsl:with-param name="msg">internal link target for '<xsl:value-of select="."/>' is ambiguous; picking first.</xsl:with-param>
     5341    </xsl:call-template>
     5342  </xsl:if>
    52925343  <xsl:choose>
    5293     <xsl:when test="$target">
     5344    <xsl:when test="$target[1]/@anchor">
    52945345      <a href="#{$target[1]/@anchor}" class="smpl">
    52955346        <xsl:call-template name="copy-anchor"/>
     
    52985349          <xsl:attribute name="id"><xsl:call-template name="compute-extref-anchor"/></xsl:attribute>
    52995350        </xsl:if>
     5351        <xsl:value-of select="."/>
     5352      </a>
     5353    </xsl:when>
     5354    <xsl:when test="$target[1]/self::x:source">
     5355      <xsl:variable name="extdoc" select="document($target[1]/@href)"/>
     5356      <xsl:variable name="nodes" select="$extdoc//*[@anchor and (x:anchor-alias/@value=$val)]"/>
     5357      <xsl:if test="not($nodes)">
     5358        <xsl:call-template name="error">
     5359          <xsl:with-param name="msg">Anchor '<xsl:value-of select="$val"/>' not found in source file '<xsl:value-of select="$target[1]/@href"/>'.</xsl:with-param>
     5360        </xsl:call-template>
     5361      </xsl:if>
     5362      <xsl:variable name="t">
     5363        <xsl:call-template name="computed-auto-target">
     5364          <xsl:with-param name="bib" select="$target[1]/.."/>
     5365          <xsl:with-param name="ref" select="$nodes[1]"/>
     5366        </xsl:call-template>
     5367      </xsl:variable>
     5368      <a href="{$t}" class="smpl">
    53005369        <xsl:value-of select="."/>
    53015370      </a>
     
    65316600    <xsl:text>http://greenbytes.de/tech/webdav/rfc2629.xslt, </xsl:text>
    65326601    <!-- when RCS keyword substitution in place, add version info -->
    6533     <xsl:if test="contains('$Revision: 1.579 $',':')">
    6534       <xsl:value-of select="concat('Revision ',normalize-space(translate(substring-after('$Revision: 1.579 $', 'Revision: '),'$','')),', ')" />
     6602    <xsl:if test="contains('$Revision: 1.584 $',':')">
     6603      <xsl:value-of select="concat('Revision ',normalize-space(translate(substring-after('$Revision: 1.584 $', 'Revision: '),'$','')),', ')" />
    65356604    </xsl:if>
    6536     <xsl:if test="contains('$Date: 2012-05-24 20:24:05 $',':')">
    6537       <xsl:value-of select="concat(normalize-space(translate(substring-after('$Date: 2012-05-24 20:24:05 $', 'Date: '),'$','')),', ')" />
     6605    <xsl:if test="contains('$Date: 2012-06-24 15:59:38 $',':')">
     6606      <xsl:value-of select="concat(normalize-space(translate(substring-after('$Date: 2012-06-24 15:59:38 $', 'Date: '),'$','')),', ')" />
    65386607    </xsl:if>
    65396608    <xsl:value-of select="concat('XSLT vendor: ',system-property('xsl:vendor'),' ',system-property('xsl:vendor-url'))" />
     
    72957364</xsl:template>
    72967365
     7366<!-- disabled for now because of https://bugzilla.gnome.org/show_bug.cgi?id=677901
    72977367<xsl:function name="exslt:node-set">
    72987368  <xsl:param name="node"/>
    72997369  <xsl:copy-of select="$node"/>
    7300 </xsl:function>
     7370</xsl:function>-->
    73017371
    73027372</xsl:transform>
Note: See TracChangeset for help on using the changeset viewer.