Ignore:
Timestamp:
12/10/2013 11:37:38 PM (11 years ago)
Author:
Krejzi <krejzi@…>
Branches:
7.5-systemd, 7.6-systemd, 7.7-systemd, 7.8-systemd, 7.9-systemd
Children:
112db9d
Parents:
f2a5108
Message:

Import new branch

git-svn-id: http://svn.linuxfromscratch.org/LFS/branches/systemd/BOOK@10389 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689

File:
1 moved

Legend:

Unmodified
Added
Removed
  • stylesheets/lfs-xsl/docbook-xsl-1.78.1/xhtml/graphics.xsl

    rf2a5108 rb1a51ac1  
    55
    66<!-- ********************************************************************
    7      $Id$
     7     $Id: graphics.xsl 9710 2013-01-22 19:34:18Z bobstayton $
    88     ********************************************************************
    99
     
    3131  <xsl:param name="ext"/>
    3232  <xsl:variable name="lcext" select="translate($ext,                                        'ABCDEFGHIJKLMNOPQRSTUVWXYZ',                                        'abcdefghijklmnopqrstuvwxyz')"/>
    33   <xsl:if test="$lcext = 'svg'              or $lcext = 'png'              or $lcext = 'jpeg'              or $lcext = 'jpg'              or $lcext = 'avi'              or $lcext = 'mpg'              or $lcext = 'mpeg'              or $lcext = 'qt'              or $lcext = 'gif'              or $lcext = 'bmp'">1</xsl:if>
     33  <xsl:if test="$lcext = 'svg'              or $lcext = 'png'              or $lcext = 'jpeg'              or $lcext = 'jpg'              or $lcext = 'avi'              or $lcext = 'mpg'              or $lcext = 'mp4'              or $lcext = 'mpeg'              or $lcext = 'qt'              or $lcext = 'gif'              or $lcext = 'acc'              or $lcext = 'mp1'              or $lcext = 'mp2'              or $lcext = 'mp3'              or $lcext = 'mp4'              or $lcext = 'm4v'              or $lcext = 'm4a'              or $lcext = 'wav'              or $lcext = 'ogv'              or $lcext = 'ogg'              or $lcext = 'webm'              or $lcext = 'bmp'">1</xsl:if>
    3434</xsl:template>
    3535
     
    3838<xsl:template match="screenshot">
    3939  <div>
    40     <xsl:apply-templates select="." mode="class.attribute"/>
     40    <xsl:apply-templates select="." mode="common.html.attributes"/>
     41    <xsl:call-template name="id.attribute"/>
     42    <xsl:call-template name="anchor"/>
    4143    <xsl:apply-templates/>
    4244  </div>
     45</xsl:template>
     46
     47<xsl:template match="screenshot/title">
     48  <xsl:call-template name="formal.object.heading">
     49    <xsl:with-param name="object" select=".."/>
     50  </xsl:call-template>
    4351</xsl:template>
    4452
     
    108116
    109117       Scale can be problematic. Scale applies to the contentwidth, so
    110        a scale of 50 when a contentwidth is not specified is analogous to a
     118       a scale of 50 when a contentwidth is not specified is analagous to a
    111119       width of 50%. (If a contentwidth is specified, the scaling factor can
    112120       be applied to that value and no problem exists.)
     
    244252    <!-- This funny compound test works around a bug in XSLTC -->
    245253    <xsl:choose>
    246       <xsl:when test="$use.extensions != 0 and $graphicsize.extension != 0">
     254      <xsl:when test="$use.extensions != 0 and $graphicsize.extension != 0                       and not(@format='SVG')">
    247255        <xsl:choose>
    248256          <xsl:when test="function-available('simg:getWidth')">
     
    277285    <!-- This funny compound test works around a bug in XSLTC -->
    278286    <xsl:choose>
    279       <xsl:when test="$use.extensions != 0 and $graphicsize.extension != 0">
     287      <xsl:when test="$use.extensions != 0 and $graphicsize.extension != 0                       and not(@format='SVG')">
    280288        <xsl:choose>
    281289          <xsl:when test="function-available('simg:getDepth')">
     
    339347        </xsl:call-template>
    340348      </xsl:variable>
    341       <xsl:value-of select="$cwidth.in.points div 72.0 * $pixels.per.inch * $scale"/>
     349      <xsl:value-of select="round($cwidth.in.points div 72.0 * $pixels.per.inch * $scale)"/>
    342350    </xsl:if>
    343351  </xsl:variable>
     
    406414        </xsl:call-template>
    407415      </xsl:variable>
    408       <xsl:value-of select="$cdepth.in.points div 72.0 * $pixels.per.inch * $scale"/>
     416      <xsl:value-of select="round($cdepth.in.points div 72.0 * $pixels.per.inch * $scale)"/>
    409417    </xsl:if>
    410418  </xsl:variable>
     
    487495    <xsl:choose>
    488496      <xsl:when test="@format = 'SVG'">
    489         <object data="{$output_filename}" type="image/svg+xml">
    490           <xsl:call-template name="process.image.attributes">
     497        <object type="image/svg+xml">
     498          <xsl:attribute name="data">
     499            <xsl:choose>
     500              <xsl:when test="$img.src.path != '' and                            $tag = 'img' and       not(starts-with($output_filename, '/')) and       not(contains($output_filename, '://'))">
     501                <xsl:value-of select="$img.src.path"/>
     502              </xsl:when>
     503           </xsl:choose>
     504           <xsl:value-of select="$output_filename"/>
     505          </xsl:attribute>
     506          <xsl:call-template name="process.image.attributes">
    491507            <!--xsl:with-param name="alt" select="$alt"/ there's no alt here-->
    492508            <xsl:with-param name="html.depth" select="$html.depth"/>
     
    510526          </xsl:if>
    511527          <xsl:if test="$use.embed.for.svg != 0">
    512             <embed src="{$output_filename}" type="image/svg+xml">
     528            <embed type="image/svg+xml">
     529              <xsl:attribute name="src">
     530                <xsl:choose>
     531                  <xsl:when test="$img.src.path != '' and       $tag = 'img' and       not(starts-with($output_filename, '/')) and       not(contains($output_filename, '://'))">
     532                    <xsl:value-of select="$img.src.path"/>
     533                  </xsl:when>
     534                </xsl:choose>
     535                <xsl:value-of select="$output_filename"/>
     536              </xsl:attribute>
    513537              <xsl:call-template name="process.image.attributes">
    514538                <!--xsl:with-param name="alt" select="$alt"/ there's no alt here -->
     
    579603                </xsl:when>
    580604                <xsl:when test="ancestor::figure">
    581                   <xsl:value-of select="normalize-space(ancestor::figure/title)"/>
     605                  <xsl:variable name="fig.title">
     606                    <xsl:apply-templates select="ancestor::figure/title/node()"/>
     607                  </xsl:variable>
     608                  <xsl:value-of select="normalize-space($fig.title)"/>
    582609                </xsl:when>
    583610              </xsl:choose>
     
    607634  <xsl:choose>
    608635    <xsl:when test="$use.viewport">
    609       <table border="0" summary="manufactured viewport for HTML img" cellspacing="0" cellpadding="0">
     636      <table border="{$table.border.off}">
     637        <xsl:if test="$div.element != 'section'">
     638          <xsl:attribute name="summary">manufactured viewport for HTML img</xsl:attribute>
     639        </xsl:if>
     640        <xsl:if test="$css.decoration != ''">
     641          <xsl:attribute name="style">cellpadding: 0; cellspacing: 0;</xsl:attribute>
     642        </xsl:if>
    610643        <xsl:if test="$html.width != ''">
    611644          <xsl:attribute name="width">
     
    939972  </xsl:if>
    940973
     974  <!-- Turn off longdesc attribute since not supported by browsers
    941975  <xsl:if test="$longdesc != ''">
    942976    <xsl:attribute name="longdesc">
     
    944978    </xsl:attribute>
    945979  </xsl:if>
     980  -->
    946981
    947982  <xsl:if test="@align and $viewport = 0">
     
    955990    </xsl:attribute>
    956991  </xsl:if>
    957 </xsl:template>
     992
     993  <xsl:call-template name="extension.process.image.attributes"/>
     994</xsl:template>
     995
     996<xsl:template name="extension.process.image.attributes"/>
    958997
    959998<!-- ==================================================================== -->
     
    9621001  <xsl:choose>
    9631002    <xsl:when test="parent::inlineequation">
    964       <xsl:call-template name="anchor"/>
    965       <xsl:call-template name="process.image"/>
     1003      <span>
     1004        <xsl:call-template name="id.attribute"/>
     1005        <xsl:call-template name="anchor"/>
     1006        <xsl:call-template name="process.image"/>
     1007      </span>
    9661008    </xsl:when>
    9671009    <xsl:otherwise>
    9681010      <div>
     1011        <xsl:call-template name="id.attribute"/>
    9691012        <xsl:if test="@align">
    9701013          <xsl:attribute name="align">
     
    10121055        </xsl:when>
    10131056        <xsl:otherwise>
    1014           <a xlink:type="simple" xlink:show="embed" xlink:actuate="onLoad" href="{$filename}"/>
    1015         </xsl:otherwise>
     1057          <xsl:message terminate="yes">
     1058            <xsl:text>Cannot insert </xsl:text><xsl:value-of select="$filename"/>
     1059            <xsl:text>. Check use.extensions and textinsert.extension parameters.</xsl:text>
     1060          </xsl:message>
     1061        </xsl:otherwise>
    10161062      </xsl:choose>
    10171063    </xsl:when>
     
    10421088
    10431089  <div>
    1044     <xsl:apply-templates select="." mode="class.attribute"/>
     1090    <xsl:apply-templates select="." mode="common.html.attributes"/>
    10451091    <xsl:if test="$align != '' ">
    10461092      <xsl:attribute name="align">
     
    10481094      </xsl:attribute>
    10491095    </xsl:if>
     1096    <xsl:call-template name="id.attribute"/>
    10501097    <xsl:call-template name="anchor"/>
    10511098
     
    10571104<xsl:template match="inlinemediaobject">
    10581105  <span>
    1059     <xsl:apply-templates select="." mode="class.attribute"/>
     1106    <xsl:apply-templates select="." mode="common.html.attributes"/>
     1107    <xsl:call-template name="id.attribute"/>
    10601108    <xsl:call-template name="anchor"/>
    10611109    <xsl:call-template name="select.mediaobject"/>
     
    10721120<xsl:template match="imageobjectco">
    10731121  <xsl:call-template name="anchor"/>
    1074   <xsl:apply-templates select="imageobject"/>
     1122  <xsl:choose>
     1123    <!-- select one imageobject? -->
     1124    <xsl:when test="$use.role.for.mediaobject != 0 and                     count(imageobject) &gt; 1 and                     imageobject[@role]">
     1125      <xsl:variable name="olist" select="imageobject"/>
     1126   
     1127      <xsl:variable name="object.index">
     1128        <xsl:call-template name="select.mediaobject.index">
     1129          <xsl:with-param name="olist" select="$olist"/>
     1130          <xsl:with-param name="count" select="1"/>
     1131        </xsl:call-template>
     1132      </xsl:variable>
     1133   
     1134      <xsl:variable name="object" select="$olist[position() = $object.index]"/>
     1135   
     1136      <xsl:apply-templates select="$object"/>
     1137    </xsl:when>
     1138    <xsl:otherwise>
     1139      <!-- otherwise process them all -->
     1140      <xsl:apply-templates select="imageobject"/>
     1141    </xsl:otherwise>
     1142  </xsl:choose>
     1143
    10751144  <xsl:apply-templates select="calloutlist"/>
     1145
    10761146</xsl:template>
    10771147
     
    11301200      <xsl:call-template name="process.image">
    11311201        <xsl:with-param name="alt">
    1132           <xsl:apply-templates select="$phrases[not(@role) or @role!='tex'][1]"/>
     1202          <xsl:choose>
     1203            <xsl:when test="ancestor::mediaobject/alt">
     1204              <xsl:apply-templates select="ancestor::mediaobject/alt"/>
     1205            </xsl:when>
     1206            <xsl:otherwise>
     1207              <xsl:apply-templates select="$phrases[not(@role) or @role!='tex'][1]"/>
     1208            </xsl:otherwise>
     1209          </xsl:choose>
    11331210        </xsl:with-param>
    11341211        <xsl:with-param name="longdesc">
     
    11651242              </xsl:when>
    11661243              <xsl:otherwise>
    1167                 <xsl:value-of select="$base.dir"/>
     1244                <xsl:value-of select="$chunk.base.dir"/>
    11681245              </xsl:otherwise>
    11691246            </xsl:choose>
     
    12421319  <xsl:variable name="this.uri">
    12431320    <xsl:call-template name="make-relative-filename">
    1244       <xsl:with-param name="base.dir" select="$base.dir"/>
     1321      <xsl:with-param name="base.dir" select="$chunk.base.dir"/>
    12451322      <xsl:with-param name="base.name">
    12461323        <xsl:call-template name="href.target.uri"/>
     
    12571334  </xsl:variable>
    12581335
    1259   <div class="longdesc-link" align="right">
     1336  <div class="longdesc-link" align="{$direction.align.end}">
    12601337    <br clear="all"/>
    12611338    <span class="longdesc-link">
     
    12691346<!-- ==================================================================== -->
    12701347
     1348<xsl:template match="mediaobject/alt">
     1349  <xsl:apply-templates/>
     1350</xsl:template>
     1351
    12711352<xsl:template match="videoobject">
    12721353  <xsl:apply-templates select="videodata"/>
     
    12771358    <xsl:with-param name="tag" select="'embed'"/>
    12781359    <xsl:with-param name="alt">
    1279       <xsl:apply-templates select="(../../textobject/phrase)[1]"/>
     1360      <xsl:choose>
     1361        <xsl:when test="ancestor::mediaobject/alt">
     1362          <xsl:apply-templates select="ancestor::mediaobject/alt"/>
     1363        </xsl:when>
     1364        <xsl:otherwise>
     1365          <xsl:apply-templates select="(ancestor::mediaobject/textobject/phrase)[1]"/>
     1366        </xsl:otherwise>
     1367      </xsl:choose>
    12801368    </xsl:with-param>
    12811369  </xsl:call-template>
     
    12921380    <xsl:with-param name="tag" select="'embed'"/>
    12931381    <xsl:with-param name="alt">
    1294       <xsl:apply-templates select="(../../textobject/phrase)[1]"/>
     1382      <xsl:choose>
     1383        <xsl:when test="ancestor::mediaobject/alt">
     1384          <xsl:apply-templates select="ancestor::mediaobject/alt"/>
     1385        </xsl:when>
     1386        <xsl:otherwise>
     1387          <xsl:apply-templates select="(ancestor::mediaobject/textobject/phrase)[1]"/>
     1388        </xsl:otherwise>
     1389      </xsl:choose>
    12951390    </xsl:with-param>
    12961391  </xsl:call-template>
     
    13431438    </xsl:when>
    13441439    <xsl:otherwise>
    1345       <a xlink:type="simple" xlink:show="embed" xlink:actuate="onLoad" href="{$filename}"/>
     1440      <xsl:message terminate="yes">
     1441        <xsl:text>Cannot insert </xsl:text><xsl:value-of select="$filename"/>
     1442        <xsl:text>. Check use.extensions and textinsert.extension parameters.</xsl:text>
     1443      </xsl:message>
    13461444    </xsl:otherwise>
    13471445  </xsl:choose>
     
    13521450<xsl:template match="caption">
    13531451  <div>
    1354     <xsl:apply-templates select="." mode="class.attribute"/>
     1452    <xsl:apply-templates select="." mode="common.html.attributes"/>
     1453    <xsl:call-template name="id.attribute"/>
    13551454    <xsl:if test="@align = 'right' or @align = 'left' or @align='center'">
    13561455      <xsl:attribute name="align"><xsl:value-of select="@align"/></xsl:attribute>
Note: See TracChangeset for help on using the changeset viewer.