]> granicus.if.org Git - docbook-dsssl/commitdiff
For RFE 790517, added parameter img.src.path as a prefix
authorBob Stayton <bobs@sagehill.net>
Thu, 12 Aug 2004 08:35:31 +0000 (08:35 +0000)
committerBob Stayton <bobs@sagehill.net>
Thu, 12 Aug 2004 08:35:31 +0000 (08:35 +0000)
to HTML img src attributes.

xsl/html/graphics.xsl
xsl/html/param.ent
xsl/html/param.xweb
xsl/params/img.src.path.xml [new file with mode: 0644]

index de702d3b8683298b91877770f604fcf9521a43cc..4213a34c74900c60107d76502194b751df0426e0 100644 (file)
@@ -512,6 +512,14 @@ valign: <xsl:value-of select="@valign"/></xsl:message>
       <xsl:otherwise>
         <xsl:element name="{$tag}">
           <xsl:attribute name="src">
+           <xsl:choose>
+             <xsl:when test="$img.src.path != '' and
+                             $tag = 'img' and
+                             not(starts-with($filename, '/')) and
+                             not(contains($filename, '://'))">
+               <xsl:value-of select="$img.src.path"/>
+             </xsl:when>
+           </xsl:choose>
             <xsl:value-of select="$filename"/>
           </xsl:attribute>
 
index a5046a3c9e375b93ab2b6d264dceb2acf739a40b..ab9ae1abbb458eec75e55f1950fecf21ac29b06e 100644 (file)
 <!ENTITY htmlhelp.title SYSTEM "../params/htmlhelp.title.xml">
 <!ENTITY htmlhelp.use.hhk SYSTEM "../params/htmlhelp.use.hhk.xml">
 <!ENTITY htmlhelp.window.geometry SYSTEM "../params/htmlhelp.window.geometry.xml">
+<!ENTITY img.src.path SYSTEM "../params/img.src.path.xml">
 <!ENTITY index.on.role SYSTEM "../params/index.on.role.xml">
 <!ENTITY index.on.type SYSTEM "../params/index.on.type.xml">
 <!ENTITY inherit.keywords SYSTEM "../params/inherit.keywords.xml">
index a6b968d11be54a78fcbbb457a13a6004be5030b3..824483f0b072796a51e14fe814601023ea6dc55e 100644 (file)
@@ -273,6 +273,7 @@ to be incomplete. Don't forget to read the source, too :-)</para>
 </reference>
 
 <reference><title>Graphics</title>
+&img.src.path;
 &graphic.default.extension;
 &default.image.width;
 &nominal.image.width;
@@ -557,6 +558,7 @@ around all these parameters.</para>
 <src:fragref linkend="htmlhelp.title.frag"/>
 <src:fragref linkend="htmlhelp.use.hhk.frag"/>
 <src:fragref linkend="htmlhelp.window.geometry.frag"/>
+<src:fragref linkend="img.src.path.frag"/>
 <src:fragref linkend="index.on.role.frag"/>
 <src:fragref linkend="index.on.type.frag"/>
 <src:fragref linkend="ignore.image.scaling.frag"/>
diff --git a/xsl/params/img.src.path.xml b/xsl/params/img.src.path.xml
new file mode 100644 (file)
index 0000000..a99b0ff
--- /dev/null
@@ -0,0 +1,30 @@
+<refentry id="img.src.path">
+<refmeta>
+<refentrytitle>img.src.path</refentrytitle>
+<refmiscinfo role="type">string</refmiscinfo>
+</refmeta>
+<refnamediv>
+<refname>img.src.path</refname>
+<refpurpose>Path to HTML image files</refpurpose>
+</refnamediv>
+
+<refsynopsisdiv>
+<src:fragment id='img.src.path.frag'><xsl:param name="img.src.path"></xsl:param></src:fragment>
+</refsynopsisdiv>
+
+<refsect1><title>Description</title>
+
+<para>Add a path prefix to each HTML
+<sgmltag class="element">img</sgmltag> element's
+<sgmltag class="attribute">src</sgmltag> attribute.
+This path could relative to the directory where the HTML
+files are created, or it could be an absolute URI.
+The default value is empty.
+Be sure to include a trailing slash if needed.
+</para>
+<para>This prefix is not applied to any filerefs that start
+with "/" or contain "//:".
+</para>
+
+</refsect1>
+</refentry>