- Timestamp:
- 12/10/2013 11:37:38 PM (11 years ago)
- Branches:
- 7.5-systemd, 7.6-systemd, 7.7-systemd, 7.8-systemd, 7.9-systemd
- Children:
- 112db9d
- Parents:
- f2a5108
- File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
stylesheets/lfs-xsl/docbook-xsl-1.78.1/fo/graphics.xsl
rf2a5108 rb1a51ac1 15 15 16 16 <!-- ******************************************************************** 17 $Id $17 $Id: graphics.xsl 9647 2012-10-26 17:42:03Z bobstayton $ 18 18 ******************************************************************** 19 19 … … 34 34 <!-- n.b. exactly one leading space, one trailing space, and one inter-word space --> 35 35 <xsl:choose> 36 <xsl:when test="$passivetex.extensions != 0">37 <xsl:text> PNG PDF JPG JPEG linespecific </xsl:text>38 </xsl:when>39 36 <xsl:when test="$fop1.extensions != 0"> 40 37 <xsl:text> BMP GIF TIFF SVG PNG EPS JPG JPEG linespecific </xsl:text> … … 63 60 <!-- n.b. exactly one leading space, one trailing space, and one inter-word space --> 64 61 <xsl:choose> 65 <xsl:when test="$passivetex.extensions != 0">66 <xsl:text> png pdf jpg jpeg </xsl:text>67 </xsl:when>68 62 <xsl:when test="$fop1.extensions != 0"> 69 63 <xsl:text> bmp gif tif tiff svg png pdf jpg jpeg eps </xsl:text> … … 94 88 </xsl:template> 95 89 96 <xsl:template name="graphic.format.content-type">97 <xsl:param name="format"/>98 <xsl:variable name="is.graphic.format">99 <xsl:call-template name="is.graphic.format">100 <xsl:with-param name="format" select="$format"/>101 </xsl:call-template>102 </xsl:variable>103 <xsl:if test="$is.graphic.format">104 <xsl:choose>105 <xsl:when test="$format = ''"></xsl:when>106 <xsl:when test="$format = 'linespecific'"></xsl:when>107 <xsl:when test="$format = 'PS'">application/postscript</xsl:when>108 <xsl:when test="$format = 'PDF'">application/pdf</xsl:when>109 <xsl:when test="$format = 'PNG'">image/png</xsl:when>110 <xsl:when test="$format = 'SVG'">image/svg+xml</xsl:when>111 <xsl:when test="$format = 'JPG'">image/jpeg</xsl:when>112 <xsl:when test="$format = 'GIF87a'">image/gif</xsl:when>113 <xsl:when test="$format = 'GIF89a'">image/gif</xsl:when>114 <xsl:otherwise>115 <xsl:value-of select="concat('image/',116 translate($format, &uppercase;, &lowercase;))"/>117 </xsl:otherwise>118 </xsl:choose>119 </xsl:if>120 </xsl:template>121 122 90 123 91 <!-- ==================================================================== --> … … 125 93 <xsl:template match="screenshot"> 126 94 <fo:block> 95 <xsl:call-template name="anchor"/> 127 96 <xsl:apply-templates/> 128 97 </fo:block> 129 98 </xsl:template> 130 99 100 <xsl:template match="screenshot/title"> 101 <xsl:call-template name="formal.object.heading"> 102 <xsl:with-param name="object" select=".."/> 103 </xsl:call-template> 104 </xsl:template> 105 131 106 <xsl:template match="screeninfo"> 132 107 </xsl:template> … … 136 111 <!-- ==================================================================== --> 137 112 138 <xsl:template name="process.image"> 139 <!-- When this template is called, the current node should be --> 140 <!-- a graphic, inlinegraphic, imagedata, or videodata. All --> 141 <!-- those elements have the same set of attributes, so we can --> 142 <!-- handle them all in one place. --> 143 144 <xsl:variable name="scalefit"> 145 <xsl:choose> 146 <xsl:when test="$ignore.image.scaling != 0">0</xsl:when> 147 <xsl:when test="@contentwidth">0</xsl:when> 148 <xsl:when test="@contentdepth and 149 @contentdepth != '100%'">0</xsl:when> 150 <xsl:when test="@scale">0</xsl:when> 151 <xsl:when test="@scalefit"><xsl:value-of select="@scalefit"/></xsl:when> 152 <xsl:when test="@width or @depth">1</xsl:when> 153 <xsl:otherwise>0</xsl:otherwise> 154 </xsl:choose> 155 </xsl:variable> 156 157 <xsl:variable name="scale"> 158 <xsl:choose> 159 <xsl:when test="$ignore.image.scaling != 0">0</xsl:when> 160 <xsl:when test="@contentwidth or @contentdepth">1.0</xsl:when> 161 <xsl:when test="@scale"> 162 <xsl:value-of select="@scale div 100.0"/> 163 </xsl:when> 164 <xsl:otherwise>1.0</xsl:otherwise> 165 </xsl:choose> 166 </xsl:variable> 167 168 <xsl:variable name="filename"> 169 <xsl:choose> 170 <xsl:when test="local-name(.) = 'graphic' 171 or local-name(.) = 'inlinegraphic'"> 172 <!-- handle legacy graphic and inlinegraphic by new template --> 173 <xsl:call-template name="mediaobject.filename"> 174 <xsl:with-param name="object" select="."/> 175 </xsl:call-template> 176 </xsl:when> 177 <xsl:otherwise> 178 <!-- imagedata, videodata, audiodata --> 179 <xsl:call-template name="mediaobject.filename"> 180 <xsl:with-param name="object" select=".."/> 181 </xsl:call-template> 182 </xsl:otherwise> 183 </xsl:choose> 184 </xsl:variable> 185 186 <xsl:variable name="content-type"> 187 <xsl:if test="@format"> 188 <xsl:call-template name="graphic.format.content-type"> 189 <xsl:with-param name="format" select="@format"/> 113 <xsl:template name="image.scalefit"> 114 <xsl:choose> 115 <xsl:when test="$ignore.image.scaling != 0">0</xsl:when> 116 <xsl:when test="@contentwidth">0</xsl:when> 117 <xsl:when test="@contentdepth and 118 @contentdepth != '100%'">0</xsl:when> 119 <xsl:when test="@scale">0</xsl:when> 120 <xsl:when test="@scalefit"><xsl:value-of select="@scalefit"/></xsl:when> 121 <xsl:when test="@width or @depth">1</xsl:when> 122 <xsl:when test="$default.image.width != ''">1</xsl:when> 123 <xsl:otherwise>0</xsl:otherwise> 124 </xsl:choose> 125 </xsl:template> 126 127 <xsl:template name="image.scale"> 128 <xsl:choose> 129 <xsl:when test="$ignore.image.scaling != 0">0</xsl:when> 130 <xsl:when test="@contentwidth or @contentdepth">1.0</xsl:when> 131 <xsl:when test="@scale"> 132 <xsl:value-of select="@scale div 100.0"/> 133 </xsl:when> 134 <xsl:otherwise>1.0</xsl:otherwise> 135 </xsl:choose> 136 </xsl:template> 137 138 <xsl:template name="image.filename"> 139 <xsl:choose> 140 <xsl:when test="svg:*" xmlns:svg="http://www.w3.org/2000/svg"> 141 <!-- no filename for inline SVG content --> 142 </xsl:when> 143 <xsl:when test="mml:*" xmlns:mml="http://www.w3.org/1998/Math/MathML"> 144 <!-- no filename for inline MathML content --> 145 </xsl:when> 146 <xsl:when test="local-name(.) = 'graphic' 147 or local-name(.) = 'inlinegraphic'"> 148 <!-- handle legacy graphic and inlinegraphic by new template --> 149 <xsl:call-template name="mediaobject.filename"> 150 <xsl:with-param name="object" select="."/> 190 151 </xsl:call-template> 191 </xsl:if> 192 </xsl:variable> 193 194 <xsl:variable name="bgcolor"> 195 <xsl:call-template name="pi.dbfo_background-color"> 196 <xsl:with-param name="node" select=".."/> 197 </xsl:call-template> 198 </xsl:variable> 199 200 <fo:external-graphic> 201 <xsl:attribute name="src"> 152 </xsl:when> 153 <xsl:otherwise> 154 <!-- imagedata, videodata, audiodata --> 155 <xsl:call-template name="mediaobject.filename"> 156 <xsl:with-param name="object" select=".."/> 157 </xsl:call-template> 158 </xsl:otherwise> 159 </xsl:choose> 160 </xsl:template> 161 162 <xsl:template name="image.src"> 163 <xsl:param name="filename"/> 164 165 <xsl:choose> 166 <xsl:when test="svg:*" xmlns:svg="http://www.w3.org/2000/svg"> 167 <!-- no src attribute for inline SVG content --> 168 </xsl:when> 169 <xsl:when test="mml:*" xmlns:mml="http://www.w3.org/1998/Math/MathML"> 170 <!-- no src attribute for inline MathML content --> 171 </xsl:when> 172 <xsl:otherwise> 202 173 <xsl:call-template name="fo-external-image"> 203 174 <xsl:with-param name="filename"> … … 210 181 </xsl:with-param> 211 182 </xsl:call-template> 212 </xsl:attribute> 213 214 <xsl:attribute name="width"> 215 <xsl:choose> 216 <xsl:when test="$ignore.image.scaling != 0">auto</xsl:when> 217 <xsl:when test="contains(@width,'%')"> 218 <xsl:value-of select="@width"/> 219 </xsl:when> 220 <xsl:when test="@width and not(@width = '')"> 221 <xsl:call-template name="length-spec"> 222 <xsl:with-param name="length" select="@width"/> 223 <xsl:with-param name="default.units" select="'px'"/> 224 </xsl:call-template> 225 </xsl:when> 226 <xsl:when test="not(@depth) and $default.image.width != ''"> 227 <xsl:call-template name="length-spec"> 228 <xsl:with-param name="length" select="$default.image.width"/> 229 <xsl:with-param name="default.units" select="'px'"/> 230 </xsl:call-template> 231 </xsl:when> 232 <xsl:otherwise>auto</xsl:otherwise> 233 </xsl:choose> 234 </xsl:attribute> 235 236 <xsl:attribute name="height"> 237 <xsl:choose> 238 <xsl:when test="$ignore.image.scaling != 0">auto</xsl:when> 239 <xsl:when test="contains(@depth,'%')"> 240 <xsl:value-of select="@depth"/> 241 </xsl:when> 242 <xsl:when test="@depth"> 243 <xsl:call-template name="length-spec"> 244 <xsl:with-param name="length" select="@depth"/> 245 <xsl:with-param name="default.units" select="'px'"/> 246 </xsl:call-template> 247 </xsl:when> 248 <xsl:otherwise>auto</xsl:otherwise> 249 </xsl:choose> 250 </xsl:attribute> 251 252 <xsl:attribute name="content-width"> 253 <xsl:choose> 254 <xsl:when test="$ignore.image.scaling != 0">auto</xsl:when> 255 <xsl:when test="contains(@contentwidth,'%')"> 256 <xsl:value-of select="@contentwidth"/> 257 </xsl:when> 258 <xsl:when test="@contentwidth"> 259 <xsl:call-template name="length-spec"> 260 <xsl:with-param name="length" select="@contentwidth"/> 261 <xsl:with-param name="default.units" select="'px'"/> 262 </xsl:call-template> 263 </xsl:when> 264 <xsl:when test="number($scale) != 1.0"> 265 <xsl:value-of select="$scale * 100"/> 266 <xsl:text>%</xsl:text> 267 </xsl:when> 268 <xsl:when test="$scalefit = 1">scale-to-fit</xsl:when> 269 <xsl:otherwise>auto</xsl:otherwise> 270 </xsl:choose> 271 </xsl:attribute> 272 273 <xsl:attribute name="content-height"> 274 <xsl:choose> 275 <xsl:when test="$ignore.image.scaling != 0">auto</xsl:when> 276 <xsl:when test="contains(@contentdepth,'%')"> 277 <xsl:value-of select="@contentdepth"/> 278 </xsl:when> 279 <xsl:when test="@contentdepth"> 280 <xsl:call-template name="length-spec"> 281 <xsl:with-param name="length" select="@contentdepth"/> 282 <xsl:with-param name="default.units" select="'px'"/> 283 </xsl:call-template> 284 </xsl:when> 285 <xsl:when test="number($scale) != 1.0"> 286 <xsl:value-of select="$scale * 100"/> 287 <xsl:text>%</xsl:text> 288 </xsl:when> 289 <xsl:when test="$scalefit = 1">scale-to-fit</xsl:when> 290 <xsl:otherwise>auto</xsl:otherwise> 291 </xsl:choose> 292 </xsl:attribute> 293 294 <xsl:if test="$content-type != ''"> 295 <xsl:attribute name="content-type"> 296 <xsl:value-of select="concat('content-type:',$content-type)"/> 297 </xsl:attribute> 298 </xsl:if> 299 300 <xsl:if test="$bgcolor != ''"> 301 <xsl:attribute name="background-color"> 302 <xsl:value-of select="$bgcolor"/> 303 </xsl:attribute> 304 </xsl:if> 305 306 <xsl:if test="@align"> 307 <xsl:attribute name="text-align"> 308 <xsl:value-of select="@align"/> 309 </xsl:attribute> 310 </xsl:if> 311 312 <xsl:if test="@valign"> 313 <xsl:attribute name="display-align"> 183 </xsl:otherwise> 184 </xsl:choose> 185 </xsl:template> 186 187 <xsl:template name="image.content.type"> 188 <xsl:if test="@format"> 189 <xsl:call-template name="graphic.format.content-type"> 190 <xsl:with-param name="format" select="@format"/> 191 </xsl:call-template> 192 </xsl:if> 193 </xsl:template> 194 195 <xsl:template name="image.bgcolor"> 196 <xsl:call-template name="pi.dbfo_background-color"> 197 <xsl:with-param name="node" select=".."/> 198 </xsl:call-template> 199 </xsl:template> 200 201 <xsl:template name="image.width"> 202 <xsl:choose> 203 <xsl:when test="$ignore.image.scaling != 0">auto</xsl:when> 204 <xsl:when test="contains(@width,'%')"> 205 <xsl:value-of select="@width"/> 206 </xsl:when> 207 <xsl:when test="@width and not(@width = '')"> 208 <xsl:call-template name="length-spec"> 209 <xsl:with-param name="length" select="@width"/> 210 <xsl:with-param name="default.units" select="'px'"/> 211 </xsl:call-template> 212 </xsl:when> 213 <xsl:when test="not(@depth) and $default.image.width != ''"> 214 <xsl:call-template name="length-spec"> 215 <xsl:with-param name="length" select="$default.image.width"/> 216 <xsl:with-param name="default.units" select="'px'"/> 217 </xsl:call-template> 218 </xsl:when> 219 <xsl:otherwise>auto</xsl:otherwise> 220 </xsl:choose> 221 </xsl:template> 222 223 <xsl:template name="image.height"> 224 <xsl:choose> 225 <xsl:when test="$ignore.image.scaling != 0">auto</xsl:when> 226 <xsl:when test="contains(@depth,'%')"> 227 <xsl:value-of select="@depth"/> 228 </xsl:when> 229 <xsl:when test="@depth"> 230 <xsl:call-template name="length-spec"> 231 <xsl:with-param name="length" select="@depth"/> 232 <xsl:with-param name="default.units" select="'px'"/> 233 </xsl:call-template> 234 </xsl:when> 235 <xsl:otherwise>auto</xsl:otherwise> 236 </xsl:choose> 237 </xsl:template> 238 239 <xsl:template name="image.content.width"> 240 <xsl:param name="scalefit" select="0"/> 241 <xsl:param name="scale" select="'1.0'"/> 242 243 <xsl:choose> 244 <xsl:when test="$ignore.image.scaling != 0">auto</xsl:when> 245 <xsl:when test="contains(@contentwidth,'%')"> 246 <xsl:value-of select="@contentwidth"/> 247 </xsl:when> 248 <xsl:when test="@contentwidth"> 249 <xsl:call-template name="length-spec"> 250 <xsl:with-param name="length" select="@contentwidth"/> 251 <xsl:with-param name="default.units" select="'px'"/> 252 </xsl:call-template> 253 </xsl:when> 254 <xsl:when test="number($scale) != 1.0"> 255 <xsl:value-of select="$scale * 100"/> 256 <xsl:text>%</xsl:text> 257 </xsl:when> 258 <xsl:when test="$scalefit = 1">scale-to-fit</xsl:when> 259 <xsl:otherwise>auto</xsl:otherwise> 260 </xsl:choose> 261 </xsl:template> 262 263 <xsl:template name="image.content.height"> 264 <xsl:param name="scalefit" select="0"/> 265 <xsl:param name="scale" select="0"/> 266 267 <xsl:choose> 268 <xsl:when test="$ignore.image.scaling != 0">auto</xsl:when> 269 <xsl:when test="contains(@contentdepth,'%')"> 270 <xsl:value-of select="@contentdepth"/> 271 </xsl:when> 272 <xsl:when test="@contentdepth"> 273 <xsl:call-template name="length-spec"> 274 <xsl:with-param name="length" select="@contentdepth"/> 275 <xsl:with-param name="default.units" select="'px'"/> 276 </xsl:call-template> 277 </xsl:when> 278 <xsl:when test="number($scale) != 1.0"> 279 <xsl:value-of select="$scale * 100"/> 280 <xsl:text>%</xsl:text> 281 </xsl:when> 282 <xsl:when test="$scalefit = 1">scale-to-fit</xsl:when> 283 <xsl:otherwise>auto</xsl:otherwise> 284 </xsl:choose> 285 </xsl:template> 286 287 <xsl:template name="image.align"> 288 <xsl:value-of select="@align"/> 289 </xsl:template> 290 291 <xsl:template name="image.valign"> 292 <xsl:if test="@valign"> 293 <xsl:choose> 294 <xsl:when test="ancestor::inlinemediaobject or ancestor-or-self::inlinegraphic"> 295 <xsl:choose> 296 <xsl:when test="@valign = 'top'">baseline</xsl:when> 297 <xsl:when test="@valign = 'middle'">central</xsl:when> 298 <xsl:when test="@valign = 'bottom'">text-before-edge</xsl:when> 299 </xsl:choose> 300 </xsl:when> 301 <xsl:otherwise> 314 302 <xsl:choose> 315 303 <xsl:when test="@valign = 'top'">before</xsl:when> 316 304 <xsl:when test="@valign = 'middle'">center</xsl:when> 317 305 <xsl:when test="@valign = 'bottom'">after</xsl:when> 318 <xsl:otherwise>auto</xsl:otherwise>319 306 </xsl:choose> 320 </xsl:attribute> 321 </xsl:if> 322 </fo:external-graphic> 307 </xsl:otherwise> 308 </xsl:choose> 309 </xsl:if> 310 </xsl:template> 311 312 313 <xsl:template name="process.image"> 314 <!-- When this template is called, the current node should be --> 315 <!-- a graphic, inlinegraphic, imagedata, or videodata. All --> 316 <!-- those elements have the same set of attributes, so we can --> 317 <!-- handle them all in one place. --> 318 319 <!-- Compute each attribute value with its own customizable template call --> 320 <xsl:variable name="scalefit"> 321 <xsl:call-template name="image.scalefit"/> 322 </xsl:variable> 323 324 <xsl:variable name="scale"> 325 <xsl:call-template name="image.scale"/> 326 </xsl:variable> 327 328 <xsl:variable name="filename"> 329 <xsl:call-template name="image.filename"/> 330 </xsl:variable> 331 332 <xsl:variable name="src"> 333 <xsl:call-template name="image.src"> 334 <xsl:with-param name="filename" select="$filename"/> 335 </xsl:call-template> 336 </xsl:variable> 337 338 <xsl:variable name="content.type"> 339 <xsl:call-template name="image.content.type"/> 340 </xsl:variable> 341 342 <xsl:variable name="bgcolor"> 343 <xsl:call-template name="image.bgcolor"/> 344 </xsl:variable> 345 346 <xsl:variable name="width"> 347 <xsl:call-template name="image.width"/> 348 </xsl:variable> 349 350 <xsl:variable name="height"> 351 <xsl:call-template name="image.height"/> 352 </xsl:variable> 353 354 <xsl:variable name="content.width"> 355 <xsl:call-template name="image.content.width"> 356 <xsl:with-param name="scalefit" select="$scalefit"/> 357 <xsl:with-param name="scale" select="$scale"/> 358 </xsl:call-template> 359 </xsl:variable> 360 361 <xsl:variable name="content.height"> 362 <xsl:call-template name="image.content.height"> 363 <xsl:with-param name="scalefit" select="$scalefit"/> 364 <xsl:with-param name="scale" select="$scale"/> 365 </xsl:call-template> 366 </xsl:variable> 367 368 <xsl:variable name="align"> 369 <xsl:call-template name="image.align"/> 370 </xsl:variable> 371 372 <xsl:variable name="valign"> 373 <xsl:call-template name="image.valign"/> 374 </xsl:variable> 375 376 <xsl:variable name="element.name"> 377 <xsl:choose> 378 <xsl:when test="svg:*" xmlns:svg="http://www.w3.org/2000/svg"> 379 <xsl:text>fo:instream-foreign-object</xsl:text> 380 </xsl:when> 381 <xsl:when test="mml:*" xmlns:mml="http://www.w3.org/1998/Math/MathML"> 382 <xsl:text>fo:instream-foreign-object</xsl:text> 383 </xsl:when> 384 <xsl:otherwise> 385 <xsl:text>fo:external-graphic</xsl:text> 386 </xsl:otherwise> 387 </xsl:choose> 388 </xsl:variable> 389 390 <xsl:element name="{$element.name}"> 391 392 <xsl:if test="$src != ''"> 393 <xsl:attribute name="src"> 394 <xsl:value-of select="$src"/> 395 </xsl:attribute> 396 </xsl:if> 397 398 <xsl:if test="$width != ''"> 399 <xsl:attribute name="width"> 400 <xsl:value-of select="$width"/> 401 </xsl:attribute> 402 </xsl:if> 403 404 <xsl:if test="$height != ''"> 405 <xsl:attribute name="height"> 406 <xsl:value-of select="$height"/> 407 </xsl:attribute> 408 </xsl:if> 409 410 <xsl:if test="$content.width != ''"> 411 <xsl:attribute name="content-width"> 412 <xsl:value-of select="$content.width"/> 413 </xsl:attribute> 414 </xsl:if> 415 416 <xsl:if test="$content.height != ''"> 417 <xsl:attribute name="content-height"> 418 <xsl:value-of select="$content.height"/> 419 </xsl:attribute> 420 </xsl:if> 421 422 <xsl:if test="$content.type != ''"> 423 <xsl:attribute name="content-type"> 424 <xsl:value-of select="concat('content-type:',$content.type)"/> 425 </xsl:attribute> 426 </xsl:if> 427 428 <xsl:if test="$bgcolor != ''"> 429 <xsl:attribute name="background-color"> 430 <xsl:value-of select="$bgcolor"/> 431 </xsl:attribute> 432 </xsl:if> 433 434 <xsl:if test="$align != ''"> 435 <xsl:attribute name="text-align"> 436 <xsl:value-of select="$align"/> 437 </xsl:attribute> 438 </xsl:if> 439 440 <xsl:if test="$valign != ''"> 441 <xsl:variable name="att.name"> 442 <xsl:choose> 443 <xsl:when test="ancestor::inlinemediaobject or ancestor-or-self::inlinegraphic"> 444 <xsl:text>alignment-baseline</xsl:text> 445 </xsl:when> 446 <xsl:otherwise> 447 <xsl:text>display-align</xsl:text> 448 </xsl:otherwise> 449 </xsl:choose> 450 </xsl:variable> 451 <xsl:attribute name="{$att.name}"> 452 <xsl:value-of select="$valign"/> 453 </xsl:attribute> 454 </xsl:if> 455 456 <!-- copy literal SVG elements to output --> 457 <xsl:if test="svg:*" xmlns:svg="http://www.w3.org/2000/svg"> 458 <xsl:call-template name="process.svg"/> 459 </xsl:if> 460 461 <xsl:if test="mml:*" xmlns:mml="http://www.w3.org/1998/Math/MathML"> 462 <xsl:call-template name="process.mml"/> 463 </xsl:if> 464 465 </xsl:element> 323 466 </xsl:template> 324 467 … … 332 475 <xsl:otherwise> 333 476 <fo:block> 477 <xsl:call-template name="anchor"/> 334 478 <xsl:if test="@align"> 335 479 <xsl:attribute name="text-align"> … … 434 578 435 579 <xsl:template match="imageobjectco"> 436 <xsl:apply-templates select="imageobject"/> 580 <xsl:choose> 581 <!-- select one imageobject? --> 582 <xsl:when test="$use.role.for.mediaobject != 0 and 583 count(imageobject) > 1 and 584 imageobject[@role]"> 585 <xsl:variable name="olist" select="imageobject"/> 586 587 <xsl:variable name="object.index"> 588 <xsl:call-template name="select.mediaobject.index"> 589 <xsl:with-param name="olist" select="$olist"/> 590 <xsl:with-param name="count" select="1"/> 591 </xsl:call-template> 592 </xsl:variable> 593 594 <xsl:variable name="object" select="$olist[position() = $object.index]"/> 595 596 <xsl:apply-templates select="$object"/> 597 </xsl:when> 598 <xsl:otherwise> 599 <!-- otherwise process them all --> 600 <xsl:apply-templates select="imageobject"/> 601 </xsl:otherwise> 602 </xsl:choose> 603 437 604 <xsl:apply-templates select="calloutlist"/> 605 438 606 </xsl:template> 439 607 … … 466 634 </xsl:template> 467 635 636 <xsl:template name="process.mml"> 637 <xsl:apply-templates mode="copy-all" select="*"/> 638 </xsl:template> 639 640 <xsl:template name="process.svg"> 641 <xsl:apply-templates mode="copy-all" select="*"/> 642 </xsl:template> 643 468 644 <!-- ==================================================================== --> 469 645 470 646 <xsl:template match="imagedata"> 471 <xsl:variable name="vendor" select="system-property('xsl:vendor')"/>472 <xsl:variable name="filename">473 <xsl:call-template name="mediaobject.filename">474 <xsl:with-param name="object" select=".."/>475 </xsl:call-template>476 </xsl:variable>477 478 647 <xsl:choose> 479 648 <xsl:when test="@format='linespecific'"> 649 <xsl:variable name="vendor" select="system-property('xsl:vendor')"/> 650 651 <xsl:variable name="filename"> 652 <xsl:call-template name="mediaobject.filename"> 653 <xsl:with-param name="object" select=".."/> 654 </xsl:call-template> 655 </xsl:variable> 656 480 657 <xsl:choose> 481 658 <xsl:when test="$use.extensions != '0' … … 589 766 <!-- ==================================================================== --> 590 767 591 <xsl:template match=" caption">768 <xsl:template match="mediaobject/caption|figure/caption"> 592 769 <fo:block> 593 770 <xsl:if test="@align = 'right' or @align = 'left' or @align='center'"> … … 605 782 606 783 <xsl:choose> 607 <xsl:when test="$passivetex.extensions != 0 608 or $fop.extensions != 0"> 784 <xsl:when test="$fop.extensions != 0"> 609 785 <xsl:value-of select="$filename"/> 610 786 </xsl:when>
Note:
See TracChangeset
for help on using the changeset viewer.