5.2.1 Non-textual information Graphic and other non-textual constructs can come from two possible sources. XSL-FO processor need not recognize the formats, only pass on the content from whatever source to rendering agent for imaging. Content need not be a static graphic image; The src property has specific syntactic requirements. -
It is safest to use url(" uri-value-here ") . -
The author of the XML document may be creating the URI being used in the resulting syntax. -
The URI character set includes the single quote that would bring about an improperly formed attribute value if the single quote is used as the delimiter . -
You could use no quote delimiters, unless the URI contains a single quote. -
You could use single quote delimiters, unless the URI contains a single quote. -
Make sure the XML syntax for attribute quotes is acceptable, e.g.: -
This is not a function call, but a syntactic convention. -
Without it, the URI syntax could be misinterpreted as expression syntax. -
Without it, any embedded single quotes (which are allowed in URI syntax and could be in the source XML without the stylesheet writer knowing) could confuse the interpretation of the literal string. 5.2.2 The external-graphic object Purpose Content Property sets -
Common accessibility properties ( 7.4 ; 326), -
common aural properties ( 7.6 ; 327), -
common border, padding, and background properties ( 7.7 ; 328), -
common margin properties inline ( 7.11 ; 333), -
common relative position properties ( 7.12 ; 333). Other required property Other optional properties -
alignment-adjust ( 7.13.1 ; 346), -
alignment-baseline ( 7.13.2 ; 346), -
baseline-shift ( 7.13.3 ; 351), -
block-progression-dimension ( 7.14.1 ; 352), -
clip ( 7.20.1 ; 368), -
content-height ( 7.14.2 ; 370), -
content-type ( 7.28.1 ; 371), -
content-width ( 7.14.3 ; 371), -
display-align ( 7.13.4 ; 373), -
dominant-baseline ( 7.13.5 ; 374), -
height ( 7.14.4 ; 382), -
id ( 7.28.2 ; 384), -
inline-progression-dimension ( 7.14.5 ; 385), -
keep-with- next ( 7.19.4 ; 386), -
keep-with-previous ( 7.19.5 ; 387), -
line-height ( 7.15.4 ; 390), -
overflow ( 7.20.2 ; 397), -
scaling ( 7.14.10 ; 411), -
scaling-method ( 7.14.11 ; 412), -
text-align ( 7.15.9 ; 421), -
width ( 7.14.12 ; 428). Shorthands influencing the above properties -
font ( 7.29.13 ; 377), -
page-break-after ( 7.29.16 ; 401), -
page-break-before ( 7.29.17 ; 401), -
vertical-align ( 7.29.22 ; 424). Property of interest An excerpt from Figure 5-2 is shown in Example 5-5. Example 5-5 An example of referencing an external resource Line 01 <block font-size="24pt" space-after="16pt" space-before="1cm" 02 text-align="center"> 03 Table of Contents 04 <block/> 05 <external-graphic src='url("smflags.bmp")'/> 06 </block> Note the following regarding the structure of this example. -
By default, white space is collapsed so that the words "Table of Contents" are flowed on the page as if separated by only one space each. -
An empty block is used to introduce a line of zero size thus breaking the title and the graphic onto separate lines. -
The protected quoted syntax is used for the URI of the graphic image. -
All inline constructs on all lines of the outside block are centered using text-align . 5.2.3 The instream-foreign-object object Purpose Content (6.6.6) Property sets -
Common accessibility properties ( 7.4 ; 326), -
common aural properties ( 7.6 ; 327), -
common border, padding, and background properties ( 7.7 ; 328), -
common margin properties inline ( 7.11 ; 333), -
common relative position properties ( 7.12 ; 333). Other optional properties -
alignment-adjust ( 7.13.1 ; 346), -
alignment-baseline ( 7.13.2 ; 346), -
baseline-shift ( 7.13.3 ; 351), -
block-progression-dimension ( 7.14.1 ; 352), -
clip ( 7.20.1 ; 368), -
content-height ( 7.14.2 ; 370), -
content-type ( 7.28.1 ; 371), -
content-width ( 7.14.3 ; 371), -
display-align ( 7.13.4 ; 373), -
dominant-baseline ( 7.13.5 ; 374), -
height ( 7.14.4 ; 382), -
id ( 7.28.2 ; 384), -
inline-progression-dimension ( 7.14.5 ; 385), -
keep-with-next ( 7.19.4 ; 386), -
keep-with-previous ( 7.19.5 ; 387), -
line-height ( 7.15.4 ; 390), -
overflow ( 7.20.2 ; 397), -
scaling ( 7.14.10 ; 411), -
scaling-method ( 7.14.11 ; 412), -
text-align ( 7.15.9 ; 421), -
width ( 7.14.12 ; 428). Shorthands influencing the above properties -
font ( 7.29.13 ; 377), -
page-break-after ( 7.29.16 ; 401), -
page-break-before ( 7.29.17 ; 401), -
vertical-align ( 7.29.22 ; 424). Property of interest Example 5-6 shows embedding alternate namespace content (in this case, Scalable Vector Graphics, SVG) into an XSL-FO instance. Example 5-6 Embedding of SVG into XSL-FO Line 01 <block text-align="center"> 02 <block> 03 <instream-foreign-object> 04 <svg:svg xmlns:svg="http://www.w3.org/2000/svg" 05 width="170" height="145"> 06 <svg:g style="stroke:black; fill:black"> 07 <svg:polygon points=" 5, 50, 5, 81, 12, 64"/> 08 <svg:polygon points=" 5, 45, 41,116, 41, 73"/> 09 <svg:polygon points=" 44, 76, 44,119, 61,115"/> 10 <svg:polygon points=" 46, 73, 75,140,105, 73"/> 11 <svg:polygon points="107, 76,107,119, 89,115"/> 12 <svg:polygon points="144, 45,110,116,110, 74"/> 13 <svg:polygon points="145, 41,167, 4,109, 71"/> 14 <svg:polygon points=" 66, 70, 75, 63, 84, 70"/> 15 </svg:g> 16 </svg:svg> 17 </instream-foreign-object> 18 </block> 19 <block font-size="20pt" font-weight="bold">Crane Logo</block> 20 </block> The rendering of the embedded image is shown in Figure 5-9. Figure 5-9. An embedded SVG image |