Changeset 1661 for rfc2629xslt/samples


Ignore:
Timestamp:
02/05/12 15:41:36 (8 years ago)
Author:
julian.reschke@…
Message:

update to latest version of rfc2629.xslt

File:
1 edited

Legend:

Unmodified
Added
Removed
  • rfc2629xslt/samples/rfc2629.xslt

    r1652 r1661  
    3131
    3232<xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    33                 version="1.0"
     33                version="2.0"
    3434               
    3535                xmlns:date="http://exslt.org/dates-and-times"
     
    662662
    663663<xsl:template match="artwork">
    664   <xsl:if test="not(ancestor::ed:del) and $xml2rfc-ext-parse-xml-in-artwork='yes' and function-available('myns:parseXml')">
     664  <xsl:if test="not(ancestor::ed:del) and $xml2rfc-ext-parse-xml-in-artwork='yes' and function-available('myns:parseXml')" use-when="function-available('myns:parseXml')">
    665665    <xsl:if test="contains(.,'&lt;?xml')">
    666666      <xsl:variable name="body" select="substring-after(substring-after(.,'&lt;?xml'),'?>')" />
     
    39533953          <xsl:when test="self::xref">
    39543954            <xsl:variable name="target" select="@target"/>
     3955            <xsl:comment>workaround for Saxon 9.1 bug; force evalutation of: <xsl:value-of select="$target"/></xsl:comment>
     3956            <xsl:variable name="no"><xsl:number level="any" count="xref[@target=$target]"/></xsl:variable>
    39553957            <xsl:text>#</xsl:text>
    39563958            <xsl:value-of select="$anchor-prefix"/>
    39573959            <xsl:text>.xref.</xsl:text>
    3958             <xsl:value-of select="@target"/>.<xsl:number level="any" count="xref[@target=$target]"/>
     3960            <xsl:value-of select="@target"/>
     3961            <xsl:text>.</xsl:text>
     3962            <xsl:value-of select="$no"/>
    39593963          </xsl:when>
    39603964          <xsl:when test="self::iref">
     
    41984202                              <xsl:sort select="translate(@subitem,$lcase,$ucase)" />
    41994203                             
    4200                               <xsl:if test="generate-id(.) = generate-id(key('index-item-subitem',concat(@item,'..',@subitem)))">
     4204                              <xsl:if test="generate-id(.) = generate-id(key('index-item-subitem',concat(@item,'..',@subitem))[1])">
    42014205                 
    42024206                                <xsl:variable name="in-artwork2" select="key('index-item-subitem',concat(@item,'..',@subitem))[@primary='true' and ancestor::artwork]" />
     
    52955299  <xsl:choose>
    52965300    <xsl:when test="$target">
    5297       <a href="#{$target/@anchor}" class="smpl">
     5301      <a href="#{$target[1]/@anchor}" class="smpl">
    52985302        <xsl:call-template name="copy-anchor"/>
    52995303        <!-- to be indexed? -->
     
    54555459    </xsl:if>
    54565460    <xsl:choose>
    5457       <xsl:when test="function-available('myns:parseXml')">
     5461      <xsl:when test="function-available('myns:parseXml')" use-when="function-available('myns:parseXml')">
    54585462        <xsl:if test="myns:parseXml(concat($cleaned,''))!=''">
    54595463          <xsl:call-template name="error">
     
    54625466        </xsl:if>
    54635467      </xsl:when>
    5464       <xsl:when test="function-available('saxon:parse')">
     5468      <xsl:when test="function-available('saxon:parse')" use-when="function-available('saxon:parse')">
    54655469        <xsl:variable name="parsed" select="saxon:parse(concat($cleaned,''))"/>
    54665470        <xsl:if test="$parsed='foo'">
     
    54685472        </xsl:if>
    54695473      </xsl:when>
     5474      <xsl:when test="false()"></xsl:when>
    54705475      <xsl:otherwise></xsl:otherwise>
    54715476    </xsl:choose>
     
    65336538    <xsl:text>http://greenbytes.de/tech/webdav/rfc2629.xslt, </xsl:text>
    65346539    <!-- when RCS keyword substitution in place, add version info -->
    6535     <xsl:if test="contains('$Revision: 1.572 $',':')">
    6536       <xsl:value-of select="concat('Revision ',normalize-space(translate(substring-after('$Revision: 1.572 $', 'Revision: '),'$','')),', ')" />
     6540    <xsl:if test="contains('$Revision: 1.576 $',':')">
     6541      <xsl:value-of select="concat('Revision ',normalize-space(translate(substring-after('$Revision: 1.576 $', 'Revision: '),'$','')),', ')" />
    65376542    </xsl:if>
    6538     <xsl:if test="contains('$Date: 2012-03-19 14:26:22 $',':')">
    6539       <xsl:value-of select="concat(normalize-space(translate(substring-after('$Date: 2012-03-19 14:26:22 $', 'Date: '),'$','')),', ')" />
     6543    <xsl:if test="contains('$Date: 2012-05-02 14:26:45 $',':')">
     6544      <xsl:value-of select="concat(normalize-space(translate(substring-after('$Date: 2012-05-02 14:26:45 $', 'Date: '),'$','')),', ')" />
    65406545    </xsl:if>
    65416546    <xsl:value-of select="concat('XSLT vendor: ',system-property('xsl:vendor'),' ',system-property('xsl:vendor-url'))" />
     
    70327037<!-- diag support -->
    70337038<xsl:template name="lineno">
    7034   <xsl:if test="function-available('saxon-old:line-number')">
     7039  <xsl:if test="function-available('saxon-old:line-number')" use-when="function-available('saxon-old:line-number')">
    70357040    <xsl:if test="saxon-old:line-number() > 0">
    70367041      <xsl:text> (at line </xsl:text>
     
    70507055    </xsl:if>
    70517056  </xsl:if>
    7052   <xsl:if test="function-available('saxon:line-number')">
     7057  <xsl:if test="function-available('saxon:line-number')" use-when="function-available('saxon:line-number')">
    70537058    <xsl:if test="saxon:line-number() > 0">
    70547059      <xsl:text> (at line </xsl:text>
     
    71017106<xsl:variable name="current-year">
    71027107  <xsl:choose>
    7103     <xsl:when test="function-available('date:date-time')">
     7108    <xsl:when test="function-available('date:date-time')" use-when="function-available('date:date-time')">
    71047109      <xsl:value-of select="substring-before(date:date-time(),'-')"/>
     7110    </xsl:when>
     7111    <xsl:when test="function-available('current-date')">
     7112      <xsl:value-of select="substring-before(string(current-date()),'-')"/>
    71057113    </xsl:when>
    71067114    <xsl:otherwise/>
     
    71107118<xsl:variable name="current-month">
    71117119  <xsl:choose>
    7112     <xsl:when test="function-available('date:date-time')">
     7120    <xsl:when test="function-available('date:date-time')" use-when="function-available('date:date-time')">
    71137121      <xsl:value-of select="substring-before(substring-after(date:date-time(),'-'),'-')"/>
     7122    </xsl:when>
     7123    <xsl:when test="function-available('current-date')">
     7124      <xsl:value-of select="substring-before(substring-after(string(current-date()),'-'),'-')"/>
    71147125    </xsl:when>
    71157126    <xsl:otherwise/>
     
    71197130<xsl:variable name="current-day">
    71207131  <xsl:choose>
    7121     <xsl:when test="function-available('date:date-time')">
     7132    <xsl:when test="function-available('date:date-time')" use-when="function-available('date:date-time')">
    71227133      <xsl:value-of select="substring-after(substring-after(substring-before(date:date-time(),'T'),'-'),'-')"/>
     7134    </xsl:when>
     7135    <xsl:when test="function-available('current-dateTime')">
     7136      <xsl:value-of select="substring-after(substring-after(substring-before(string(current-dateTime()),'T'),'-'),'-')"/>
    71237137    </xsl:when>
    71247138    <xsl:otherwise/>
     
    72887302</xsl:template>
    72897303
     7304<xsl:function name="exslt:node-set">
     7305  <xsl:param name="node"/>
     7306  <xsl:copy-of select="$node"/>
     7307</xsl:function>
     7308
    72907309</xsl:transform>
Note: See TracChangeset for help on using the changeset viewer.