Ver Fonte

Updated docbook-xsl-snapshot to r6792

git-svn-id: http://svn.linuxfromscratch.org/LFS/branches/new-xsl@8102 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689
Manuel Canales Esparcia há 18 anos atrás
pai
commit
eaa2a64022

+ 1 - 1
docbook-xsl-snapshot/VERSION

@@ -17,7 +17,7 @@
 <fm:project>
   <fm:Project>DocBook</fm:Project>
   <fm:Branch>XSL Stylesheets</fm:Branch>
-  <fm:Version>snapshot_6771</fm:Version>
+  <fm:Version>snapshot_6792</fm:Version>
 <!--
   <fm:License>MIT/X Consortium License</fm:License>
 -->

+ 4 - 2
docbook-xsl-snapshot/fo/callout.xsl

@@ -136,9 +136,11 @@
     <xsl:when test="$callout.graphics != '0'
                     and $conum &lt;= $callout.graphics.number.limit">
       <xsl:variable name="filename"
-                    select="concat($callout.graphics.path,$conum,$callout.graphics.extension)"/>
+                    select="concat($callout.graphics.path, $conum,
+		                   $callout.graphics.extension)"/>
 
-      <fo:external-graphic>
+      <fo:external-graphic content-width="{$callout.icon.size}"
+                           width="{$callout.icon.size}">
         <xsl:attribute name="src">
           <xsl:choose>
             <xsl:when test="$passivetex.extensions != 0

+ 1 - 1
docbook-xsl-snapshot/fo/footnote.xsl

@@ -90,7 +90,7 @@
         <!-- FIXME: list in @from is probably not complete -->
         <xsl:number level="any" 
                     from="chapter|appendix|preface|article|refentry|bibliography" 
-                    count="footnote[not(@label)][not(ancestor::table) and not(ancestor::informaltable)]|ulink[$ulink.footnotes != 0][node()][@url != .][not(ancestor::footnote)]" 
+                    count="footnote[not(@label)][not(ancestor::table) and not(ancestor::informaltable)]|ulink[$ulink.footnotes != 0][node()][@url != .][not(ancestor::footnote)][ulink.show != 0]" 
                     format="1"/>
       </xsl:variable>
       <xsl:choose>

+ 18 - 1
docbook-xsl-snapshot/fo/inline.xsl

@@ -41,7 +41,7 @@
                     and (not($node/@xlink:type) or 
                          $node/@xlink:type='simple')">
 
-      <!-- Is it a local idref or a uri? -->
+      <!-- Is it a local idref? -->
       <xsl:variable name="is.idref">
         <xsl:choose>
           <!-- if the href starts with # and does not contain an "(" -->
@@ -54,6 +54,17 @@
         </xsl:choose>
       </xsl:variable>
 
+      <!-- Is it an olink ? -->
+      <xsl:variable name="is.olink">
+        <xsl:choose>
+	  <!-- If xlink:role="http://docbook.org/xlink/role/olink" -->
+          <!-- and if the href contains # -->
+          <xsl:when test="contains($xhref,'#') and
+	       @xlink:role = $xolink.role">1</xsl:when>
+          <xsl:otherwise>0</xsl:otherwise>
+        </xsl:choose>
+      </xsl:variable>
+
       <xsl:choose>
         <xsl:when test="$is.idref = 1">
 
@@ -87,6 +98,12 @@
           </xsl:choose>
         </xsl:when>
 
+        <xsl:when test="$is.olink = 1">
+	  <xsl:call-template name="olink">
+	    <xsl:with-param name="content" select="$content"/>
+	  </xsl:call-template>
+        </xsl:when>
+
         <!-- otherwise it's a URI -->
         <xsl:otherwise>
           <fo:basic-link external-destination="url({$xhref})">

+ 7 - 2
docbook-xsl-snapshot/fo/param.xsl

@@ -96,9 +96,12 @@
 <xsl:param name="body.end.indent" select="'0pt'"/>
 <xsl:param name="bridgehead.in.toc" select="0"/>
 <xsl:param name="callout.defaultcolumn" select="'60'"/>
-<xsl:param name="callout.graphics.extension" select="'.png'"/>
+
+<xsl:param name="callout.graphics.extension" select="'.svg'"/>
 <xsl:param name="callout.graphics" select="'1'"/>
-<xsl:param name="callout.graphics.number.limit" select="'15'"/>
+<xsl:param name="callout.icon.size">7pt</xsl:param>
+
+<xsl:param name="callout.graphics.number.limit" select="'30'"/>
 <xsl:param name="callout.graphics.path" select="'images/callouts/'"/>
 <xsl:param name="callout.unicode.font" select="'ZapfDingbats'"/>
 <xsl:param name="callout.unicode" select="0"/>
@@ -553,6 +556,7 @@ set       toc,title
 <xsl:param name="process.empty.source.toc" select="0"/>
 <xsl:param name="process.source.toc" select="0"/>
 <xsl:param name="profile.arch" select="''"/>
+<xsl:param name="profile.audience" select="''"/>
 <xsl:param name="profile.attribute" select="''"/>
 <xsl:param name="profile.condition" select="''"/>
 <xsl:param name="profile.conformance" select="''"/>
@@ -567,6 +571,7 @@ set       toc,title
 <xsl:param name="profile.userlevel" select="''"/>
 <xsl:param name="profile.value" select="''"/>
 <xsl:param name="profile.vendor" select="''"/>
+<xsl:param name="profile.wordsize" select="''"/>
 <xsl:param name="punct.honorific" select="'.'"/>
 <xsl:param name="qanda.defaultlabel">number</xsl:param>
 <xsl:param name="qanda.in.toc" select="0"/>

+ 3 - 3
docbook-xsl-snapshot/fo/table.xsl

@@ -559,9 +559,9 @@ to be incomplete. Don't forget to read the source, too :-)</para>
   <xsl:variable name="column.sum">
     <xsl:choose>
       <!-- CALS table -->
-      <xsl:when test="tgroup[1][@cols]">
-        <xsl:if test="count(tgroup[1]/colspec) = tgroup/@cols">
-          <xsl:for-each select="tgroup[1]/colspec">
+      <xsl:when test="@cols">
+        <xsl:if test="count(colspec) = @cols">
+          <xsl:for-each select="colspec">
             <xsl:if test="position() != 1">
               <xsl:text> + </xsl:text>
             </xsl:if>

+ 47 - 9
docbook-xsl-snapshot/fo/xref.xsl

@@ -16,6 +16,10 @@
 
      ******************************************************************** -->
 
+<!-- Use internal variable for olink xlink role for consistency -->
+<xsl:variable 
+      name="xolink.role">http://docbook.org/xlink/role/olink</xsl:variable>
+
 <!-- ==================================================================== -->
 
 <xsl:template match="anchor">
@@ -966,15 +970,42 @@
 </xsl:template>
 
 <xsl:template match="olink" name="olink">
+  <!-- olink content may be passed in from xlink olink -->
+  <xsl:param name="content" select="NOTANELEMENT"/>
+
   <xsl:call-template name="anchor"/>
 
   <xsl:variable name="localinfo" select="@localinfo"/>
 
   <xsl:choose>
     <!-- olinks resolved by stylesheet and target database -->
-    <xsl:when test="@targetdoc or @targetptr" >
-      <xsl:variable name="targetdoc.att" select="@targetdoc"/>
-      <xsl:variable name="targetptr.att" select="@targetptr"/>
+    <xsl:when test="@targetdoc or @targetptr or
+                    (@xlink:role=$xolink.role and
+                     contains(@xlink:href, '#') )" >
+
+      <xsl:variable name="targetdoc.att">
+        <xsl:choose>
+          <xsl:when test="@targetdoc != ''">
+            <xsl:value-of select="@targetdoc"/>
+          </xsl:when>
+          <xsl:when test="@xlink:role=$xolink.role and
+                       contains(@xlink:href, '#')" >
+            <xsl:value-of select="substring-before(@xlink:href, '#')"/>
+          </xsl:when>
+        </xsl:choose>
+      </xsl:variable>
+
+      <xsl:variable name="targetptr.att">
+        <xsl:choose>
+          <xsl:when test="@targetptr != ''">
+            <xsl:value-of select="@targetptr"/>
+          </xsl:when>
+          <xsl:when test="@xlink:role=$xolink.role and
+                       contains(@xlink:href, '#')" >
+            <xsl:value-of select="substring-after(@xlink:href, '#')"/>
+          </xsl:when>
+        </xsl:choose>
+      </xsl:variable>
 
       <xsl:variable name="olink.lang">
         <xsl:call-template name="l10n.language">
@@ -1038,11 +1069,18 @@
       </xsl:variable>
 
       <xsl:variable name="hottext">
-        <xsl:call-template name="olink.hottext">
-          <xsl:with-param name="olink.key" select="$olink.key"/>
-          <xsl:with-param name="olink.lang" select="$olink.lang"/>
-          <xsl:with-param name="target.database" select="$target.database"/>
-        </xsl:call-template>
+        <xsl:choose>
+          <xsl:when test="$content">
+            <xsl:copy-of select="$content"/>
+          </xsl:when>
+          <xsl:otherwise>
+            <xsl:call-template name="olink.hottext">
+              <xsl:with-param name="olink.key" select="$olink.key"/>
+              <xsl:with-param name="olink.lang" select="$olink.lang"/>
+              <xsl:with-param name="target.database" select="$target.database"/>
+            </xsl:call-template>
+          </xsl:otherwise>
+        </xsl:choose>
       </xsl:variable>
 
       <xsl:variable name="olink.docname.citation">
@@ -1174,7 +1212,7 @@
   <xsl:param name="localinfo"/>
   <xsl:param name="return" select="href"/>
 
-  <xsl:message terminate="yes">Fatal error: what is this supposed to do?</xsl:message>
+  <xsl:message terminate="yes">Fatal error: olink.outline template: what is this supposed to do?</xsl:message>
 </xsl:template>
 
 <!-- ==================================================================== -->

+ 48 - 11
docbook-xsl-snapshot/profiling/profile-mode.xsl

@@ -25,6 +25,18 @@
   <xsl:variable name="arch.ok" select="not(@arch) or not($profile.arch) or
                                        $arch.content != '' or @arch = ''"/>
 
+  <xsl:variable name="audience.content">
+    <xsl:if test="@audience">
+      <xsl:call-template name="cross.compare">
+        <xsl:with-param name="a" select="$profile.audience"/>
+        <xsl:with-param name="b" select="@audience"/>
+      </xsl:call-template>
+    </xsl:if>
+  </xsl:variable>
+  <xsl:variable name="audience.ok" 
+                        select="not(@audience) or not($profile.audience) or
+                                $audience.content != '' or @audience = ''"/>
+
   <xsl:variable name="condition.content">
     <xsl:if test="@condition">
       <xsl:call-template name="cross.compare">
@@ -146,6 +158,18 @@
   <xsl:variable name="vendor.ok" select="not(@vendor) or not($profile.vendor) or
                                          $vendor.content != '' or @vendor = ''"/>
 
+  <xsl:variable name="wordsize.content">
+    <xsl:if test="@wordsize">
+      <xsl:call-template name="cross.compare">
+        <xsl:with-param name="a" select="$profile.wordsize"/>
+        <xsl:with-param name="b" select="@wordsize"/>
+      </xsl:call-template>
+    </xsl:if>
+  </xsl:variable>
+  <xsl:variable name="wordsize.ok" 
+                        select="not(@wordsize) or not($profile.wordsize) or
+                                $wordsize.content != '' or @wordsize = ''"/>
+
   <xsl:variable name="attribute.content">
     <xsl:if test="@*[local-name()=$profile.attribute]">
       <xsl:call-template name="cross.compare">
@@ -155,26 +179,39 @@
     </xsl:if>
   </xsl:variable>
   <xsl:variable name="attribute.ok" 
-                select="not(@*[local-name()=$profile.attribute]) or not($profile.value) or
-                        $attribute.content != '' or 
-                        @*[local-name()=$profile.attribute] = '' or not($profile.attribute)"/>
-
-  <xsl:if test="$arch.ok and $condition.ok and $conformance.ok and $lang.ok and $os.ok 
-                and $revision.ok and $revisionflag.ok and $role.ok and $security.ok
-		and $status.ok and $userlevel.ok and $vendor.ok and $attribute.ok">
+                select="not(@*[local-name()=$profile.attribute]) or 
+                        not($profile.value) or $attribute.content != '' or 
+                        @*[local-name()=$profile.attribute] = '' or 
+                        not($profile.attribute)"/>
+
+  <xsl:if test="$arch.ok and 
+                $audience.ok and 
+                $condition.ok and 
+                $conformance.ok and 
+                $lang.ok and 
+                $os.ok and 
+                $revision.ok and 
+                $revisionflag.ok and 
+                $role.ok and 
+                $security.ok and 
+                $status.ok and 
+                $userlevel.ok and 
+                $vendor.ok and 
+                $wordsize.ok and 
+                $attribute.ok">
     <xsl:copy>
       <xsl:copy-of select="@*"/>
 
       <!-- Entity references must be replaced with filereferences for temporary tree -->
       <xsl:if test="@entityref and $profile.baseuri.fixup">
-	<xsl:attribute name="fileref">
-	  <xsl:value-of select="unparsed-entity-uri(@entityref)"/>
-	</xsl:attribute>
+        <xsl:attribute name="fileref">
+          <xsl:value-of select="unparsed-entity-uri(@entityref)"/>
+        </xsl:attribute>
       </xsl:if>
 
       <!-- xml:base is eventually added to the root element -->
       <xsl:if test="not(../..) and $profile.baseuri.fixup">
-	<xsl:call-template name="add-xml-base"/>
+        <xsl:call-template name="add-xml-base"/>
       </xsl:if>
 
       <xsl:apply-templates select="node()" mode="profile"/>

+ 2 - 0
docbook-xsl-snapshot/profiling/profile.xsl

@@ -23,6 +23,7 @@
 
 <!-- Profiling parameters -->
 <xsl:param name="profile.arch" select="''"/>
+<xsl:param name="profile.audience" select="''"/>
 <xsl:param name="profile.condition" select="''"/>
 <xsl:param name="profile.conformance" select="''"/>
 <xsl:param name="profile.lang" select="''"/>
@@ -34,6 +35,7 @@
 <xsl:param name="profile.status" select="''"/>
 <xsl:param name="profile.userlevel" select="''"/>
 <xsl:param name="profile.vendor" select="''"/>
+<xsl:param name="profile.wordsize" select="''"/>
 <xsl:param name="profile.attribute" select="''"/>
 <xsl:param name="profile.value" select="''"/>
 <xsl:param name="profile.separator" select="';'"/>

+ 16 - 0
docbook-xsl-snapshot/xhtml/inline.xsl

@@ -35,6 +35,16 @@
           </xsl:choose>
         </xsl:variable>
 
+        <!-- Is it an olink ? -->
+        <xsl:variable name="is.olink">
+          <xsl:choose>
+	    <!-- If xlink:role="http://docbook.org/xlink/role/olink" -->
+            <!-- and if the href contains # -->
+            <xsl:when test="contains($xhref,'#') and           @xlink:role = $xolink.role">1</xsl:when>
+            <xsl:otherwise>0</xsl:otherwise>
+          </xsl:choose>
+        </xsl:variable>
+
         <xsl:choose>
           <xsl:when test="$is.idref = 1">
 
@@ -94,6 +104,12 @@
             </xsl:choose>
           </xsl:when>
 
+          <xsl:when test="$is.olink = 1">
+	    <xsl:call-template name="olink">
+	      <xsl:with-param name="content" select="$content"/>
+	    </xsl:call-template>
+          </xsl:when>
+
           <!-- otherwise it's a URI -->
           <xsl:otherwise>
             <a>

+ 4 - 0
docbook-xsl-snapshot/xhtml/param.xsl

@@ -81,8 +81,10 @@ div.annotation-close { position: absolute;
 <xsl:param name="bridgehead.in.toc" select="0"/>
 <xsl:param name="callout.defaultcolumn" select="'60'"/>
 <xsl:param name="callout.graphics.extension" select="'.png'"/>
+
 <xsl:param name="callout.graphics" select="'1'"/>
 <xsl:param name="callout.graphics.number.limit" select="'15'"/>
+
 <xsl:param name="callout.graphics.path" select="'images/callouts/'"/>
 <xsl:param name="callout.list.table" select="'1'"/>
 <xsl:param name="callout.unicode" select="0"/>
@@ -313,6 +315,7 @@ set       toc,title
 <xsl:param name="process.empty.source.toc" select="0"/>
 <xsl:param name="process.source.toc" select="0"/>
 <xsl:param name="profile.arch" select="''"/>
+<xsl:param name="profile.audience" select="''"/>
 <xsl:param name="profile.attribute" select="''"/>
 <xsl:param name="profile.condition" select="''"/>
 <xsl:param name="profile.conformance" select="''"/>
@@ -327,6 +330,7 @@ set       toc,title
 <xsl:param name="profile.userlevel" select="''"/>
 <xsl:param name="profile.value" select="''"/>
 <xsl:param name="profile.vendor" select="''"/>
+<xsl:param name="profile.wordsize" select="''"/>
 <xsl:param name="punct.honorific" select="'.'"/>
 <xsl:param name="qanda.defaultlabel">number</xsl:param>
 <xsl:param name="qanda.inherit.numeration" select="1"/>

+ 40 - 8
docbook-xsl-snapshot/xhtml/xref.xsl

@@ -13,6 +13,9 @@
 
      ******************************************************************** -->
 
+<!-- Use internal variable for olink xlink role for consistency -->
+<xsl:variable name="xolink.role">http://docbook.org/xlink/role/olink</xsl:variable>
+
 <!-- ==================================================================== -->
 
 <xsl:template match="anchor">
@@ -933,6 +936,8 @@
 </xsl:template>
 
 <xsl:template match="olink" name="olink">
+  <!-- olink content may be passed in from xlink olink -->
+  <xsl:param name="content" select="NOTANELEMENT"/>
 
   <xsl:call-template name="anchor"/>
 
@@ -940,9 +945,29 @@
 
   <xsl:choose>
     <!-- olinks resolved by stylesheet and target database -->
-    <xsl:when test="@targetdoc or @targetptr">
-      <xsl:variable name="targetdoc.att" select="@targetdoc"/>
-      <xsl:variable name="targetptr.att" select="@targetptr"/>
+    <xsl:when test="@targetdoc or @targetptr or                     (@xlink:role=$xolink.role and                      contains(@xlink:href, '#') )">
+
+      <xsl:variable name="targetdoc.att">
+        <xsl:choose>
+          <xsl:when test="@targetdoc != ''">
+            <xsl:value-of select="@targetdoc"/>
+          </xsl:when>
+          <xsl:when test="@xlink:role=$xolink.role and                        contains(@xlink:href, '#')">
+            <xsl:value-of select="substring-before(@xlink:href, '#')"/>
+          </xsl:when>
+        </xsl:choose>
+      </xsl:variable>
+
+      <xsl:variable name="targetptr.att">
+        <xsl:choose>
+          <xsl:when test="@targetptr != ''">
+            <xsl:value-of select="@targetptr"/>
+          </xsl:when>
+          <xsl:when test="@xlink:role=$xolink.role and                        contains(@xlink:href, '#')">
+            <xsl:value-of select="substring-after(@xlink:href, '#')"/>
+          </xsl:when>
+        </xsl:choose>
+      </xsl:variable>
 
       <xsl:variable name="olink.lang">
         <xsl:call-template name="l10n.language">
@@ -998,11 +1023,18 @@
       </xsl:variable>
 
       <xsl:variable name="hottext">
-        <xsl:call-template name="olink.hottext">
-          <xsl:with-param name="target.database" select="$target.database"/>
-          <xsl:with-param name="olink.key" select="$olink.key"/>
-          <xsl:with-param name="olink.lang" select="$olink.lang"/>
-        </xsl:call-template>
+        <xsl:choose>
+          <xsl:when test="$content">
+            <xsl:copy-of select="$content"/>
+          </xsl:when>
+          <xsl:otherwise>
+            <xsl:call-template name="olink.hottext">
+              <xsl:with-param name="olink.key" select="$olink.key"/>
+              <xsl:with-param name="olink.lang" select="$olink.lang"/>
+              <xsl:with-param name="target.database" select="$target.database"/>
+            </xsl:call-template>
+          </xsl:otherwise>
+        </xsl:choose>
       </xsl:variable>
 
       <xsl:variable name="olink.docname.citation">

+ 2 - 0
lfs-profile.xsl

@@ -24,6 +24,7 @@
   <!-- Profiling parameters:
          profile.separator changed from ; to , to let in work in command line. -->
   <xsl:param name="profile.arch" select="''"/>
+  <xsl:param name="profile.audience" select="''"/>
   <xsl:param name="profile.condition" select="''"/>
   <xsl:param name="profile.conformance" select="''"/>
   <xsl:param name="profile.lang" select="''"/>
@@ -35,6 +36,7 @@
   <xsl:param name="profile.status" select="''"/>
   <xsl:param name="profile.userlevel" select="''"/>
   <xsl:param name="profile.vendor" select="''"/>
+  <xsl:param name="profile.wordsize" select="''"/>
   <xsl:param name="profile.attribute" select="''"/>
   <xsl:param name="profile.value" select="''"/>
   <xsl:param name="profile.separator" select="','"/>