labs-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From resc...@apache.org
Subject svn commit: r602933 - in /labs/webarch/trunk/http/draft-fielding-http: clean-for-DTD.xslt rfc2629.xslt
Date Mon, 10 Dec 2007 15:40:38 GMT
Author: reschke
Date: Mon Dec 10 07:40:37 2007
New Revision: 602933

URL: http://svn.apache.org/viewvc?rev=602933&view=rev
Log:
Update to latest version of rfc2629.xslt & friends (support for cross-document linking)

Modified:
    labs/webarch/trunk/http/draft-fielding-http/clean-for-DTD.xslt
    labs/webarch/trunk/http/draft-fielding-http/rfc2629.xslt

Modified: labs/webarch/trunk/http/draft-fielding-http/clean-for-DTD.xslt
URL: http://svn.apache.org/viewvc/labs/webarch/trunk/http/draft-fielding-http/clean-for-DTD.xslt?rev=602933&r1=602932&r2=602933&view=diff
==============================================================================
--- labs/webarch/trunk/http/draft-fielding-http/clean-for-DTD.xslt (original)
+++ labs/webarch/trunk/http/draft-fielding-http/clean-for-DTD.xslt Mon Dec 10 07:40:37 2007
@@ -197,22 +197,30 @@
     </xsl:choose>
   </xsl:variable>
 
+  <xsl:variable name="fmt">
+    <xsl:choose>
+      <xsl:when test="@x:fmt!=''"><xsl:value-of select="@x:fmt"/></xsl:when>
+      <xsl:when test="ancestor::artwork">,</xsl:when>
+      <xsl:otherwise>of</xsl:otherwise>
+    </xsl:choose>
+  </xsl:variable>
+
   <xsl:choose>
-    <xsl:when test="@x:fmt=','">
+    <xsl:when test="$fmt=','">
       <xref>
         <xsl:apply-templates select="@target|@format|@pageno|text()|*" mode="cleanup"/>
       </xref>
       <xsl:text>, Section </xsl:text>
       <xsl:value-of select="$sec"/>
     </xsl:when>
-    <xsl:when test="@x:fmt='sec'">
+    <xsl:when test="$fmt='sec'">
       <xsl:text>Section </xsl:text>
       <xsl:value-of select="$sec"/>
     </xsl:when>
-    <xsl:when test="@x:fmt='number'">
+    <xsl:when test="$fmt='number'">
       <xsl:value-of select="$sec"/>
     </xsl:when>
-    <xsl:when test="@x:fmt='()'">
+    <xsl:when test="$fmt='()'">
       <xref>
         <xsl:apply-templates select="@target|@format|@pageno|text()|*" mode="cleanup"/>
       </xref>
@@ -220,7 +228,7 @@
       <xsl:value-of select="$sec"/>
       <xsl:text>)</xsl:text>
     </xsl:when>
-    <xsl:when test="@x:fmt='of'">
+    <xsl:when test="$fmt='of'">
       <xsl:text>Section </xsl:text>
       <xsl:value-of select="$sec"/>
       <xsl:text> of </xsl:text>
@@ -228,7 +236,7 @@
         <xsl:apply-templates select="@target|@format|@pageno|text()|*" mode="cleanup"/>
       </xref>
     </xsl:when>
-    <xsl:when test="@x:fmt='anchor'">
+    <xsl:when test="$fmt='anchor'">
       <xsl:variable name="val">
         <xsl:call-template name="referencename">
           <xsl:with-param name="node" select="$node" />

Modified: labs/webarch/trunk/http/draft-fielding-http/rfc2629.xslt
URL: http://svn.apache.org/viewvc/labs/webarch/trunk/http/draft-fielding-http/rfc2629.xslt?rev=602933&r1=602932&r2=602933&view=diff
==============================================================================
--- labs/webarch/trunk/http/draft-fielding-http/rfc2629.xslt (original)
+++ labs/webarch/trunk/http/draft-fielding-http/rfc2629.xslt Mon Dec 10 07:40:37 2007
@@ -1816,6 +1816,14 @@
         </xsl:choose>
       </xsl:variable>
 
+      <xsl:variable name="fmt">
+        <xsl:choose>
+          <xsl:when test="@x:fmt!=''"><xsl:value-of select="@x:fmt"/></xsl:when>
+          <xsl:when test="ancestor::artwork">,</xsl:when>
+          <xsl:otherwise>of</xsl:otherwise>
+        </xsl:choose>
+      </xsl:variable>
+
       <xsl:variable name="title">
         <xsl:choose>
           <xsl:when test="starts-with(@x:rel,'#') and not(@x:sec) and $node/x:source/@href">
@@ -1844,22 +1852,22 @@
         number  SS
       -->
       
-      <xsl:if test="@x:fmt and not(@x:fmt='()' or @x:fmt=',' or @x:fmt='of' or @x:fmt='sec'
or @x:fmt='anchor' or @x:fmt='number')">
-        <xsl:message>unknown xref/@x:fmt extension: <xsl:value-of select="@x:fmt"/></xsl:message>
-        <span class="error">unknown xref/@x:fmt extension: <xsl:value-of select="@x:fmt"/></span>
+      <xsl:if test="$fmt and not($fmt='()' or $fmt=',' or $fmt='of' or $fmt='sec' or $fmt='anchor'
or $fmt='number')">
+        <xsl:message>unknown xref/@x:fmt extension: <xsl:value-of select="$fmt"/></xsl:message>
+        <span class="error">unknown xref/@x:fmt extension: <xsl:value-of select="$fmt"/></span>
       </xsl:if>
 
       <xsl:if test="$sec!=''">
-
+              
         <xsl:choose>
-          <xsl:when test="@x:fmt='of' or @x:fmt='sec'">
+          <xsl:when test="$fmt='of' or $fmt='sec'">
             <xsl:choose>
               <xsl:when test="$href!=''">
                 <a href="{$href}">
                   <xsl:if test="$title!=''">
                     <xsl:attribute name="title"><xsl:value-of select="$title"/></xsl:attribute>
                   </xsl:if>
-                  <xsl:if test="@x:fmt='sec' and $xml2rfc-ext-include-references-in-index='yes'">
+                  <xsl:if test="$fmt='sec' and $xml2rfc-ext-include-references-in-index='yes'">
                     <xsl:attribute name="id"><xsl:value-of select="$anchor"/></xsl:attribute>
                   </xsl:if>
                   <xsl:text>Section </xsl:text>
@@ -1868,11 +1876,11 @@
               </xsl:when>
               <xsl:otherwise>Section <xsl:value-of select="$sec"/></xsl:otherwise>
             </xsl:choose>
-            <xsl:if test="@x:fmt='of'">
+            <xsl:if test="$fmt='of'">
               <xsl:text> of </xsl:text>
             </xsl:if>
           </xsl:when>
-          <xsl:when test="@x:fmt='number'">
+          <xsl:when test="$fmt='number'">
             <xsl:choose>
               <xsl:when test="$href!=''">
                 <a href="{$href}">
@@ -1888,11 +1896,11 @@
               <xsl:otherwise><xsl:value-of select="$sec"/></xsl:otherwise>
             </xsl:choose>
           </xsl:when>
-          <xsl:otherwise/>
+          <xsl:otherwise />
         </xsl:choose>
       </xsl:if>
 
-      <xsl:if test="$sec='' or (@x:fmt!='sec' and @x:fmt!='number')">
+      <xsl:if test="$sec='' or ($fmt!='sec' and $fmt!='number')">
         <a href="#{$target}">
           <xsl:if test="$xml2rfc-ext-include-references-in-index='yes'">
             <xsl:attribute name="id"><xsl:value-of select="$anchor"/></xsl:attribute>
@@ -1904,7 +1912,7 @@
               </xsl:call-template>
             </xsl:variable>
             <xsl:choose>
-              <xsl:when test="@x:fmt='anchor'">
+              <xsl:when test="$fmt='anchor'">
                 <!-- remove brackets -->
                 <xsl:value-of select="substring($val,2,string-length($val)-2)"/>
               </xsl:when>
@@ -1918,7 +1926,7 @@
       
       <xsl:if test="$sec!=''">
         <xsl:choose>
-          <xsl:when test="@x:fmt='()'">
+          <xsl:when test="$fmt='()'">
             <xsl:text> (</xsl:text>
             <xsl:choose>
               <xsl:when test="$href!=''">
@@ -1928,7 +1936,7 @@
             </xsl:choose>
             <xsl:text>)</xsl:text>
           </xsl:when>
-          <xsl:when test="@x:fmt=','">
+          <xsl:when test="$fmt=','">
             <xsl:text>, </xsl:text>
             <xsl:choose>
               <xsl:when test="$href!=''">
@@ -3347,6 +3355,8 @@
   <xsl:param name="target" />
   <xsl:param name="title" />
   <xsl:param name="tocparam" />
+  <xsl:param name="oldtitle" />
+  <xsl:param name="waschanged" />
 
   <!-- handle tocdepth parameter -->
   <xsl:choose>
@@ -3381,7 +3391,17 @@
             </xsl:call-template>
             <xsl:text>&#160;&#160;&#160;</xsl:text>
           </xsl:if>
-          <a href="#{$target}"><xsl:value-of select="$title"/></a>
+          <a href="#{$target}">
+            <xsl:choose>
+              <xsl:when test="$waschanged!=''">
+                <ins><xsl:value-of select="$title"/></ins>
+                <del><xsl:value-of select="$oldtitle"/></del>
+              </xsl:when>
+              <xsl:otherwise>
+                <xsl:value-of select="$title"/>
+              </xsl:otherwise>
+            </xsl:choose>
+          </a>
         </xsl:otherwise>
       </xsl:choose>
     </xsl:otherwise>
@@ -3545,6 +3565,8 @@
         <xsl:with-param name="target" select="$target"/>
         <xsl:with-param name="title" select="@title"/>
         <xsl:with-param name="tocparam" select="@toc"/>
+        <xsl:with-param name="oldtitle" select="@ed:old-title"/>
+        <xsl:with-param name="waschanged" select="@ed:resolves"/>
       </xsl:call-template>
     
       <ul class="toc">
@@ -3560,6 +3582,8 @@
         <xsl:with-param name="target" select="$target"/>
         <xsl:with-param name="title" select="@title"/>
         <xsl:with-param name="tocparam" select="@toc"/>
+        <xsl:with-param name="oldtitle" select="@ed:old-title"/>
+        <xsl:with-param name="waschanged" select="@ed:resolves"/>
       </xsl:call-template>
     
       <!-- obtain nested content, just to check whether we need to recurse at all -->
@@ -3720,7 +3744,7 @@
 <!-- internal ref support -->
 <xsl:template match="x:ref">
   <xsl:variable name="val" select="."/>
-  <xsl:variable name="target" select="//*[(@anchor and x:anchor-alias/@value=$val) or
(@anchor=$val)]"/>
+  <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)]"/>
   <xsl:choose>
     <xsl:when test="$target">
       <a href="#{$target/@anchor}" class="smpl"><xsl:value-of select="."/></a>
@@ -4588,11 +4612,11 @@
   <xsl:variable name="gen">
     <xsl:text>http://greenbytes.de/tech/webdav/rfc2629.xslt, </xsl:text>
     <!-- when RCS keyword substitution in place, add version info -->
-    <xsl:if test="contains('$Revision: 1.349 $',':')">
-      <xsl:value-of select="concat('Revision ',normalize-space(translate(substring-after('$Revision:
1.349 $', 'Revision: '),'$','')),', ')" />
+    <xsl:if test="contains('$Revision: 1.352 $',':')">
+      <xsl:value-of select="concat('Revision ',normalize-space(translate(substring-after('$Revision:
1.352 $', 'Revision: '),'$','')),', ')" />
     </xsl:if>
-    <xsl:if test="contains('$Date: 2007/11/09 13:18:10 $',':')">
-      <xsl:value-of select="concat(normalize-space(translate(substring-after('$Date: 2007/11/09
13:18:10 $', 'Date: '),'$','')),', ')" />
+    <xsl:if test="contains('$Date: 2007/12/09 19:23:50 $',':')">
+      <xsl:value-of select="concat(normalize-space(translate(substring-after('$Date: 2007/12/09
19:23:50 $', 'Date: '),'$','')),', ')" />
     </xsl:if>
     <xsl:value-of select="concat('XSLT vendor: ',system-property('xsl:vendor'),' ',system-property('xsl:vendor-url'))"
/>
   </xsl:variable>



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@labs.apache.org
For additional commands, e-mail: commits-help@labs.apache.org


Mime
View raw message