]> granicus.if.org Git - docbook-dsssl/commitdiff
Use common pi-attribute template
authorNorman Walsh <ndw@nwalsh.com>
Wed, 28 Nov 2001 13:46:47 +0000 (13:46 +0000)
committerNorman Walsh <ndw@nwalsh.com>
Wed, 28 Nov 2001 13:46:47 +0000 (13:46 +0000)
xsl/fo/pi.xsl
xsl/html/pi.xsl

index 72c574ce5b7eea43107aa4d76b1108453cf11a29..77fb593075d1c331b7aac1092df7356cb5e7752f 100644 (file)
 <xsl:template name="dbfo-attribute">
   <xsl:param name="pis" select="processing-instruction('dbfo')"/>
   <xsl:param name="attribute">filename</xsl:param>
-  <xsl:param name="count">1</xsl:param>
 
-  <xsl:choose>
-    <xsl:when test="$count>count($pis)">
-      <!-- not found -->
-    </xsl:when>
-    <xsl:otherwise>
-      <xsl:variable name="pi">
-        <xsl:value-of select="$pis[$count]"/>
-      </xsl:variable>
-      <xsl:choose>
-        <xsl:when test="contains($pi,concat($attribute, '='))">
-          <xsl:variable name="rest" select="substring-after($pi,concat($attribute,'='))"/>
-          <xsl:variable name="quote" select="substring($rest,1,1)"/>
-          <xsl:value-of select="substring-before(substring($rest,2),$quote)"/>
-        </xsl:when>
-        <xsl:otherwise>
-          <xsl:call-template name="dbfo-attribute">
-            <xsl:with-param name="pis" select="$pis"/>
-            <xsl:with-param name="attribute" select="$attribute"/>
-            <xsl:with-param name="count" select="$count + 1"/>
-          </xsl:call-template>
-        </xsl:otherwise>
-      </xsl:choose>
-    </xsl:otherwise>
-  </xsl:choose>
+  <xsl:call-template name="pi-attribute">
+    <xsl:with-param name="pis" select="$pis"/>
+    <xsl:with-param name="attribute" select="$attribute"/>
+  </xsl:call-template>
 </xsl:template>
 
 <xsl:template name="dbfo-filename">
index 0788b9796fdcb11669daa02c6f654567e5f61f44..d3da3d90c794a94e0b1d122de641b6c3de5f6bf4 100644 (file)
 <xsl:template name="dbhtml-attribute">
   <xsl:param name="pis" select="processing-instruction('dbhtml')"/>
   <xsl:param name="attribute">filename</xsl:param>
-  <xsl:param name="count">1</xsl:param>
 
-  <xsl:choose>
-    <xsl:when test="$count &gt; count($pis)">
-      <!-- not found -->
-    </xsl:when>
-    <xsl:otherwise>
-      <xsl:variable name="pi">
-        <xsl:value-of select="$pis[$count]"/>
-      </xsl:variable>
-      <xsl:choose>
-        <xsl:when test="contains($pi,concat($attribute, '='))">
-          <xsl:variable name="rest" select="substring-after($pi,concat($attribute,'='))"/>
-          <xsl:variable name="quote" select="substring($rest,1,1)"/>
-          <xsl:value-of select="substring-before(substring($rest,2),$quote)"/>
-        </xsl:when>
-        <xsl:otherwise>
-          <xsl:call-template name="dbhtml-attribute">
-            <xsl:with-param name="pis" select="$pis"/>
-            <xsl:with-param name="attribute" select="$attribute"/>
-            <xsl:with-param name="count" select="$count + 1"/>
-          </xsl:call-template>
-        </xsl:otherwise>
-      </xsl:choose>
-    </xsl:otherwise>
-  </xsl:choose>
+  <xsl:call-template name="pi-attribute">
+    <xsl:with-param name="pis" select="$pis"/>
+    <xsl:with-param name="attribute" select="$attribute"/>
+  </xsl:call-template>
 </xsl:template>
 
 <xsl:template name="dbhtml-filename">