Ignore:
Timestamp:
01/06/09 13:21:15 (11 years ago)
Author:
julian.reschke@…
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • rfc2629xslt/clean-for-DTD.xslt

    r502 r588  
    153153          <xsl:when test="self::preamble">
    154154            <!-- it's not an element we can link to -->
    155             <xsl:comment>clean-for-DTD.xslt warning: couldn't create the link as <xsl:value-of select="name()"/> does not support the anchor attribute.</xsl:comment>
     155            <xsl:call-template name="warning">
     156              <xsl:with-param name="inline" select="'no'"/>
     157              <xsl:with-param name="msg">couldn't create the link as <xsl:value-of select="name()"/> does not support the anchor attribute.</xsl:with-param>
     158            </xsl:call-template>
    156159            <xsl:value-of select="$current"/>
    157160          </xsl:when>
     
    163166    </xsl:when>
    164167    <xsl:otherwise>
    165       <xsl:message>WARNING: internal link target for '<xsl:value-of select="."/>' does not exist.</xsl:message>
     168      <xsl:call-template name="warning">
     169        <xsl:with-param name="inline" select="'no'"/>
     170        <xsl:with-param name="msg">internal link target for '<xsl:value-of select="."/>' does not exist.</xsl:with-param>
     171      </xsl:call-template>
    166172      <xsl:value-of select="."/>
    167173    </xsl:otherwise>
     
    235241
    236242<xsl:template match="xref[@x:* and not(node())]" mode="cleanup">
     243  <xsl:call-template name="insert-iref-for-xref"/>
    237244  <xsl:variable name="node" select="$src//*[@anchor=current()/@target]" />
    238245
     
    322329
    323330<xsl:template match="xref[@x:fmt and node()]" mode="cleanup">
     331  <xsl:call-template name="insert-iref-for-xref"/>
    324332  <xsl:choose>
    325333    <xsl:when test="@x:fmt='none'">
     
    338346</xsl:template>
    339347
    340 <xsl:template match="xref[node() and @target=//preamble/@anchor]" mode="cleanup">
     348<xsl:template match="xref[node() and (@target=//preamble/@anchor or @target=//spanx/@anchor)]" mode="cleanup">
    341349  <!-- remove the link -->
    342350  <xsl:apply-templates select="node()" mode="cleanup"/>
    343351</xsl:template>
    344352
    345 <xsl:template match="xref[not(node()) and @target=//preamble/@anchor]" mode="cleanup">
     353<xsl:template match="xref[not(node()) and (@target=//preamble/@anchor or @target=//spanx/@anchor)]" mode="cleanup">
    346354  <!-- fatal -->
    347   <xsl:message>Broken xref due to target being filtered out.</xsl:message>
     355  <xsl:message terminate="yes">Broken xref <xsl:value-of select="@target"/> due to target being filtered out.</xsl:message>
     356</xsl:template>
     357
     358<xsl:template match="xref" mode="cleanup" priority="0">
     359  <xsl:call-template name="insert-iref-for-xref"/>
     360  <xref>
     361    <xsl:copy-of select="@target|@format"/>
     362    <xsl:apply-templates mode="cleanup"/>
     363  </xref>
     364</xsl:template>
     365
     366<xsl:template name="insert-iref-for-xref">
     367  <xsl:if test="$xml2rfc-ext-include-references-in-index='yesxxx'">
     368    <xsl:if test="@target=/rfc/back//reference/@anchor">
     369      <iref item="{@target}"/>
     370      <xsl:if test="@x:sec">
     371        <xsl:choose>
     372          <xsl:when test="translate(substring(@x:sec,1,1),$ucase,'')=''">
     373            <iref item="{@target}" subitem="Appendix {@x:sec}"/>
     374          </xsl:when>
     375          <xsl:otherwise>
     376            <iref item="{@target}" subitem="Section {@x:sec}"/>
     377          </xsl:otherwise>
     378        </xsl:choose>
     379      </xsl:if>
     380    </xsl:if>
     381  </xsl:if>
    348382</xsl:template>
    349383
     
    522556<!-- markup inside artwork element -->
    523557
    524 <xsl:template match="figure[.//artwork//iref]" mode="cleanup">
     558<xsl:template match="figure[.//artwork//iref | .//artwork//xref]" mode="cleanup">
    525559  <!-- move up iref elements -->
     560  <xsl:for-each select=".//artwork//xref">
     561    <xsl:if test="not(ancestor::ed:del)">
     562      <xsl:call-template name="insert-iref-for-xref"/>
     563    </xsl:if>
     564  </xsl:for-each>
    526565  <figure>
    527566    <xsl:apply-templates select="@*" mode="cleanup" />
    528567    <xsl:apply-templates select=".//artwork//iref" mode="cleanup"/>
    529     <xsl:apply-templates select="iref|preamble|artwork|postamble" mode="cleanup" />
     568    <xsl:apply-templates select="iref|preamble|artwork|postamble|ed:replace|ed:ins|ed:del" mode="cleanup" />
    530569  </figure>
    531570</xsl:template>
     
    611650<xsl:template match="texttable/@style" mode="cleanup"/>
    612651
    613 <!-- anchor extensions -->
    614 <xsl:template match="preamble/@anchor" mode="cleanup"/>
    615 
    616652<!-- section numbering -->
    617653<xsl:template match="section/@x:fixed-section-number" mode="cleanup"/>
     
    626662<xsl:template match="rdf:*" mode="cleanup"/>
    627663
     664<!-- cases where xml2rfc does not allow anchors -->
     665<xsl:template match="preamble/@anchor" mode="cleanup"/>
     666<xsl:template match="spanx/@anchor" mode="cleanup"/>
     667
    628668</xsl:transform>
Note: See TracChangeset for help on using the changeset viewer.