Ignore:
Timestamp:
Jul 18, 2008, 3:37:21 AM (12 years ago)
Author:
julian.reschke@…
Message:

Upgrade to latest version of rfc2629.xslt

File:
1 edited

Legend:

Unmodified
Added
Removed
  • rfc2629xslt/rfc2629.xslt

    r272 r285  
    3838                xmlns:msxsl="urn:schemas-microsoft-com:xslt"
    3939                xmlns:myns="mailto:julian.reschke@greenbytes.de?subject=rcf2629.xslt"
     40                xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    4041                xmlns:saxon-old="http://icl.com/saxon"
    4142                xmlns:saxon="http://saxon.sf.net/"
     
    4344                xmlns:xhtml="http://www.w3.org/1999/xhtml"
    4445
    45                 exclude-result-prefixes="date ed exslt msxsl myns saxon saxon-old x xhtml"
     46                exclude-result-prefixes="date ed exslt msxsl myns rdf saxon saxon-old x xhtml"
    4647                >
    4748
     
    633634        </span>
    634635      </xsl:for-each>
    635       <xsl:if test="address/uri">
     636      <xsl:for-each select="address/uri">
     637        <xsl:variable name="uri">
     638          <xsl:call-template name="extract-uri"/>
     639        </xsl:variable>
     640
    636641        <span class="vcardline">
    637642          <xsl:text>URI: </xsl:text>
    638           <a href="{address/uri}" class="url"><xsl:value-of select="address/uri" /></a>
     643          <a href="{$uri}" class="url"><xsl:value-of select="$uri" /></a>
    639644        </span>
    640       </xsl:if>
     645      </xsl:for-each>
    641646    </address>
    642647
     
    40014006<xsl:template match="x:dfn">
    40024007  <dfn>
     4008    <xsl:if test="@anchor">
     4009      <xsl:attribute name="id"><xsl:value-of select="@anchor"/></xsl:attribute>
     4010    </xsl:if>
    40034011    <xsl:apply-templates/>
    40044012  </dfn>
     
    40464054  <xsl:apply-templates/>
    40474055</xsl:template>
     4056
     4057<xsl:template match="x:parse-xml">
     4058  <xsl:apply-templates/>
     4059
     4060  <xsl:if test="function-available('exslt:node-set')">
     4061    <xsl:variable name="cleaned">
     4062      <xsl:apply-templates mode="cleanup-edits"/>
     4063    </xsl:variable>
     4064    <xsl:choose>
     4065      <xsl:when test="function-available('myns:parseXml')">
     4066        <xsl:if test="myns:parseXml(concat($cleaned,''))!=''">
     4067          <xsl:call-template name="error">
     4068            <xsl:with-param name="msg" select="concat('Parse error in XML: ', myns:parseXml(concat($cleaned,'')))"/>
     4069          </xsl:call-template>
     4070        </xsl:if>
     4071      </xsl:when>
     4072      <xsl:when test="function-available('saxon:parse')">
     4073        <xsl:variable name="parsed" select="saxon:parse(concat($cleaned,''))"/>
     4074        <xsl:if test="$parsed='foo'">
     4075          <xsl:comment>should not get here</xsl:comment>
     4076        </xsl:if>
     4077      </xsl:when>
     4078      <xsl:otherwise></xsl:otherwise>
     4079    </xsl:choose>
     4080  </xsl:if>
     4081</xsl:template>
     4082
     4083<!-- inlined RDF support -->
     4084<xsl:template match="rdf:Description">
     4085  <!-- ignore -->
     4086</xsl:template>
     4087
     4088<!-- cleanup for ins/del -->
     4089
     4090<xsl:template match="comment()|@*" mode="cleanup-edits"><xsl:copy/></xsl:template>
     4091
     4092<xsl:template match="text()" mode="cleanup-edits"><xsl:copy/></xsl:template>
     4093
     4094<xsl:template match="/" mode="cleanup-edits">
     4095        <xsl:copy><xsl:apply-templates select="node()" mode="cleanup-edits" /></xsl:copy>
     4096</xsl:template>
     4097
     4098<xsl:template match="ed:del" mode="cleanup-edits"/>
     4099
     4100<xsl:template match="ed:replace" mode="cleanup-edits">
     4101  <xsl:apply-templates mode="cleanup-edits"/>
     4102</xsl:template>
     4103
     4104<xsl:template match="ed:ins" mode="cleanup-edits">
     4105  <xsl:apply-templates mode="cleanup-edits"/>
     4106</xsl:template>
     4107
    40484108
    40494109<!-- ABNF support -->
     
    46644724  <xsl:param name="msg2"/>
    46654725  <xsl:param name="inline"/>
    4666   <xsl:if test="$inline='no'">
     4726  <xsl:if test="$inline!='no'">
    46674727    <div class="error">ERROR: <xsl:value-of select="$msg"/><xsl:value-of select="$msg2"/></div>
    46684728  </xsl:if>
     
    49354995    <xsl:text>http://greenbytes.de/tech/webdav/rfc2629.xslt, </xsl:text>
    49364996    <!-- when RCS keyword substitution in place, add version info -->
    4937     <xsl:if test="contains('$Revision: 1.379 $',':')">
    4938       <xsl:value-of select="concat('Revision ',normalize-space(translate(substring-after('$Revision: 1.379 $', 'Revision: '),'$','')),', ')" />
     4997    <xsl:if test="contains('$Revision: 1.384 $',':')">
     4998      <xsl:value-of select="concat('Revision ',normalize-space(translate(substring-after('$Revision: 1.384 $', 'Revision: '),'$','')),', ')" />
    49394999    </xsl:if>
    4940     <xsl:if test="contains('$Date: 2008-07-06 13:38:32 $',':')">
    4941       <xsl:value-of select="concat(normalize-space(translate(substring-after('$Date: 2008-07-06 13:38:32 $', 'Date: '),'$','')),', ')" />
     5000    <xsl:if test="contains('$Date: 2008-07-18 10:33:47 $',':')">
     5001      <xsl:value-of select="concat(normalize-space(translate(substring-after('$Date: 2008-07-18 10:33:47 $', 'Date: '),'$','')),', ')" />
    49425002    </xsl:if>
    49435003    <xsl:value-of select="concat('XSLT vendor: ',system-property('xsl:vendor'),' ',system-property('xsl:vendor-url'))" />
     
    50015061          </xsl:for-each>
    50025062        </xsl:when>
     5063        <xsl:when test="ancestor::reference">
     5064          <xsl:for-each select="ancestor::reference">
     5065            <xsl:call-template name="get-section-number"/>
     5066          </xsl:for-each>
     5067        </xsl:when>
    50035068        <xsl:when test="ancestor::back"><xsl:number count="section|appendix" level="multiple" format="A.1.1.1.1.1.1.1" /></xsl:when>
    50045069        <xsl:when test="self::appendix"><xsl:number count="appendix" level="multiple" format="A.1.1.1.1.1.1.1" /></xsl:when>
     
    50935158 
    50945159  <xsl:value-of select="$email2"/>
     5160</xsl:template>
     5161
     5162<!-- checking for uri element -->
     5163<xsl:template name="extract-uri">
     5164  <xsl:variable name="uri" select="normalize-space(.)"/>
     5165  <xsl:if test="string-length(.) != string-length($uri) or contains($uri,' ')">
     5166    <xsl:call-template name="warning">
     5167      <xsl:with-param name="inline" select="'no'"/>
     5168      <xsl:with-param name="msg">excessive whitespace in URI: '<xsl:value-of select="."/>'</xsl:with-param>
     5169    </xsl:call-template>
     5170  </xsl:if>
     5171 
     5172  <xsl:value-of select="$uri"/>
    50955173</xsl:template>
    50965174
Note: See TracChangeset for help on using the changeset viewer.