FOPRunXSLTExt/examples/balisage2014.xml
author Tony Graham
Tue, 29 Jul 2014 00:33:22 +0100
changeset 55 873cf39a5e9c
parent 51 53a9f2fe79d0
child 56 b184e200b875
permissions -rwxr-xr-x
Added 'bogus' function definition to illustrate handling of short
labels. Minor text changes.
44
902a8c95ed31 Using 'pygmentize' to style the markup. Improved one list.
Tony Graham
parents: 43
diff changeset
     1
<example name="Balisage 2014">
46
dc5ee4f88add Minor changes.
Tony Graham
parents: 44
diff changeset
     2
<header>Print and Page Layout <svg href="ppl-logo.svg" id="logo"/> Community Group<lb/>XSLT Extensions</header>
14
f9507e36d645 Added font-size adjustment example.
Tony Graham
parents:
diff changeset
     3
51
53a9f2fe79d0 Added more text.
Tony Graham
parents: 46
diff changeset
     4
<box id="box001" width="2240pt" height="540pt">
53a9f2fe79d0 Added more text.
Tony Graham
parents: 46
diff changeset
     5
<paragraph id="para001">The XSLT extension functions from the Print and Page Layout Community Group @ W3C (see <url>https://www.w3.org/community/ppl/wiki/XSLTExtensions</url>) allow you to run your XSL-FO formatter within your XSLT transform, and do it as often as you like, to get an area tree and make decisions based on formatted areas to do things like:</paragraph>
53a9f2fe79d0 Added more text.
Tony Graham
parents: 46
diff changeset
     6
<list id="list009">
55
873cf39a5e9c Added 'bogus' function definition to illustrate handling of short
Tony Graham
parents: 51
diff changeset
     7
  <item label="*">Adjust the start-indent of a <code>fo:list-block</code> based on the length of the longest <code>fo:list-item-label</code>; or</item>
51
53a9f2fe79d0 Added more text.
Tony Graham
parents: 46
diff changeset
     8
  <item label="*">Size this text to be <font-size/> so it fits this box.</item>
53a9f2fe79d0 Added more text.
Tony Graham
parents: 46
diff changeset
     9
</list>
14
f9507e36d645 Added font-size adjustment example.
Tony Graham
parents:
diff changeset
    10
</box>
55
873cf39a5e9c Added 'bogus' function definition to illustrate handling of short
Tony Graham
parents: 51
diff changeset
    11
<box id="box002" width="2240pt" height="630pt" columns="2" border="none">
51
53a9f2fe79d0 Added more text.
Tony Graham
parents: 46
diff changeset
    12
<title>XSLT and XSL-FO Processors</title>
43
7db8588cbd7d Files for potential Balisage 2014 poster.
Tony Graham
parents: 33
diff changeset
    13
<paragraph id="para002">The extension is available for Java and DotNet and uses either the Apache FOP XSL formatter or Antenna House AHF formatter to produce the area trees.</paragraph>
7db8588cbd7d Files for potential Balisage 2014 poster.
Tony Graham
parents: 33
diff changeset
    14
<paragraph>The single Java jar file covers four combinations of XSLT processor and XSL-FO formatter:</paragraph>
7db8588cbd7d Files for potential Balisage 2014 poster.
Tony Graham
parents: 33
diff changeset
    15
<list id="list001">
7db8588cbd7d Files for potential Balisage 2014 poster.
Tony Graham
parents: 33
diff changeset
    16
  <item label="*">Saxon 9.5 and FOP</item>
7db8588cbd7d Files for potential Balisage 2014 poster.
Tony Graham
parents: 33
diff changeset
    17
  <item label="*">Saxon 9.5 and Antenna House</item>
7db8588cbd7d Files for potential Balisage 2014 poster.
Tony Graham
parents: 33
diff changeset
    18
  <item label="*">Xalan and FOP</item>
7db8588cbd7d Files for potential Balisage 2014 poster.
Tony Graham
parents: 33
diff changeset
    19
  <item label="*">Xalan and Antenna House</item>
7db8588cbd7d Files for potential Balisage 2014 poster.
Tony Graham
parents: 33
diff changeset
    20
</list>
7db8588cbd7d Files for potential Balisage 2014 poster.
Tony Graham
parents: 33
diff changeset
    21
<paragraph>The DotNet version supports:</paragraph>
7db8588cbd7d Files for potential Balisage 2014 poster.
Tony Graham
parents: 33
diff changeset
    22
7db8588cbd7d Files for potential Balisage 2014 poster.
Tony Graham
parents: 33
diff changeset
    23
<list id="list002">
7db8588cbd7d Files for potential Balisage 2014 poster.
Tony Graham
parents: 33
diff changeset
    24
  <item label="*">DotNet 4.0 and FOP</item>
7db8588cbd7d Files for potential Balisage 2014 poster.
Tony Graham
parents: 33
diff changeset
    25
  <item label="*">DotNet 4.0 and Antenna House</item>
7db8588cbd7d Files for potential Balisage 2014 poster.
Tony Graham
parents: 33
diff changeset
    26
</list>
51
53a9f2fe79d0 Added more text.
Tony Graham
parents: 46
diff changeset
    27
<title>API</title>
53a9f2fe79d0 Added more text.
Tony Graham
parents: 46
diff changeset
    28
<paragraph>The PPL CG provides <code>ppl:area-tree()</code> for running the formatter and getting the area tree plus a selection of convenience functions to help hide both the details of the area tree and the differences between the area trees of different XSL-FO formatters.</paragraph>
44
902a8c95ed31 Using 'pygmentize' to style the markup. Improved one list.
Tony Graham
parents: 43
diff changeset
    29
<api-list id="list003">
902a8c95ed31 Using 'pygmentize' to style the markup. Improved one list.
Tony Graham
parents: 43
diff changeset
    30
  <item>
902a8c95ed31 Using 'pygmentize' to style the markup. Improved one list.
Tony Graham
parents: 43
diff changeset
    31
    <function>ppl:area-tree($fo-tree as node()) as document-node()</function>
902a8c95ed31 Using 'pygmentize' to style the markup. Improved one list.
Tony Graham
parents: 43
diff changeset
    32
    <def>Runs the XSL-FO formatter on $fo-tree to get an area tree.</def>
902a8c95ed31 Using 'pygmentize' to style the markup. Improved one list.
Tony Graham
parents: 43
diff changeset
    33
  </item>
902a8c95ed31 Using 'pygmentize' to style the markup. Improved one list.
Tony Graham
parents: 43
diff changeset
    34
  <item>
902a8c95ed31 Using 'pygmentize' to style the markup. Improved one list.
Tony Graham
parents: 43
diff changeset
    35
    <function>ppl:block-by-id($area-tree as document-node(), $id as string) as element()?</function>
902a8c95ed31 Using 'pygmentize' to style the markup. Improved one list.
Tony Graham
parents: 43
diff changeset
    36
<def>Returns the block area with ID $id.</def>
902a8c95ed31 Using 'pygmentize' to style the markup. Improved one list.
Tony Graham
parents: 43
diff changeset
    37
  </item>
902a8c95ed31 Using 'pygmentize' to style the markup. Improved one list.
Tony Graham
parents: 43
diff changeset
    38
  <item>
902a8c95ed31 Using 'pygmentize' to style the markup. Improved one list.
Tony Graham
parents: 43
diff changeset
    39
    <function>ppl:block-bpd($block as element()) as xs:double</function>
902a8c95ed31 Using 'pygmentize' to style the markup. Improved one list.
Tony Graham
parents: 43
diff changeset
    40
    <def>Returns the block-progression-dimension of $block in points.</def>
902a8c95ed31 Using 'pygmentize' to style the markup. Improved one list.
Tony Graham
parents: 43
diff changeset
    41
  </item>
902a8c95ed31 Using 'pygmentize' to style the markup. Improved one list.
Tony Graham
parents: 43
diff changeset
    42
  <item>
902a8c95ed31 Using 'pygmentize' to style the markup. Improved one list.
Tony Graham
parents: 43
diff changeset
    43
    <function>ppl:block-bpd($block as element()) as xs:double</function>
902a8c95ed31 Using 'pygmentize' to style the markup. Improved one list.
Tony Graham
parents: 43
diff changeset
    44
    <def>Returns the inline-progression-dimension of $block in points.</def>
902a8c95ed31 Using 'pygmentize' to style the markup. Improved one list.
Tony Graham
parents: 43
diff changeset
    45
  </item>
902a8c95ed31 Using 'pygmentize' to style the markup. Improved one list.
Tony Graham
parents: 43
diff changeset
    46
  <item>
902a8c95ed31 Using 'pygmentize' to style the markup. Improved one list.
Tony Graham
parents: 43
diff changeset
    47
    <function>ppl:block-available-ipd($block as element()) as xs:double</function>
902a8c95ed31 Using 'pygmentize' to style the markup. Improved one list.
Tony Graham
parents: 43
diff changeset
    48
    <def>Returns the difference, in points, between the inline-progression-dimension of $block and the inline-progression-dimension of its ancestor reference area.</def>
902a8c95ed31 Using 'pygmentize' to style the markup. Improved one list.
Tony Graham
parents: 43
diff changeset
    49
  </item>
51
53a9f2fe79d0 Added more text.
Tony Graham
parents: 46
diff changeset
    50
  <item>
53a9f2fe79d0 Added more text.
Tony Graham
parents: 46
diff changeset
    51
    <function>ppl:is-first($block as element()) as xs:boolean</function>
53a9f2fe79d0 Added more text.
Tony Graham
parents: 46
diff changeset
    52
    <def>Returns the value of the <code>is-first</code> trait.</def>
53a9f2fe79d0 Added more text.
Tony Graham
parents: 46
diff changeset
    53
  </item>
53a9f2fe79d0 Added more text.
Tony Graham
parents: 46
diff changeset
    54
  <item>
53a9f2fe79d0 Added more text.
Tony Graham
parents: 46
diff changeset
    55
    <function>ppl:is-last($block as element()) as xs:boolean</function>
53a9f2fe79d0 Added more text.
Tony Graham
parents: 46
diff changeset
    56
    <def>Returns the value of the <code>is-last</code> trait.</def>
53a9f2fe79d0 Added more text.
Tony Graham
parents: 46
diff changeset
    57
  </item>
53a9f2fe79d0 Added more text.
Tony Graham
parents: 46
diff changeset
    58
  <item>
53a9f2fe79d0 Added more text.
Tony Graham
parents: 46
diff changeset
    59
    <function>ppl:sum-lengths-to-inches($lengths as xs:string*) as xs:double</function>
53a9f2fe79d0 Added more text.
Tony Graham
parents: 46
diff changeset
    60
    <def>Returns the length, in inches, of the sum of a sequence of lengths represented as strings, e.g., &#x201C;<code>6pt</code>&#x201D;, etc.</def>
53a9f2fe79d0 Added more text.
Tony Graham
parents: 46
diff changeset
    61
  </item>
53a9f2fe79d0 Added more text.
Tony Graham
parents: 46
diff changeset
    62
  <item>
53a9f2fe79d0 Added more text.
Tony Graham
parents: 46
diff changeset
    63
    <function>ppl:sum-lengths-to-pt($lengths as xs:string*) as xs:double</function>
53a9f2fe79d0 Added more text.
Tony Graham
parents: 46
diff changeset
    64
    <def>Returns the length, in points (1/72 of an inch), of the sum of a sequence of lengths represented as strings, e.g., &#x201C;<code>6pt</code>&#x201D;, etc.</def>
53a9f2fe79d0 Added more text.
Tony Graham
parents: 46
diff changeset
    65
  </item>
55
873cf39a5e9c Added 'bogus' function definition to illustrate handling of short
Tony Graham
parents: 51
diff changeset
    66
  <item>
873cf39a5e9c Added 'bogus' function definition to illustrate handling of short
Tony Graham
parents: 51
diff changeset
    67
    <function>bogus</function>
873cf39a5e9c Added 'bogus' function definition to illustrate handling of short
Tony Graham
parents: 51
diff changeset
    68
    <def>Not a function, just an illustration of how, by using the extension functions to find the formatted size of the function definition, the <code>fo:list-item-body</code> moves down only for long function definitions.</def>
873cf39a5e9c Added 'bogus' function definition to illustrate handling of short
Tony Graham
parents: 51
diff changeset
    69
  </item>
44
902a8c95ed31 Using 'pygmentize' to style the markup. Improved one list.
Tony Graham
parents: 43
diff changeset
    70
</api-list>
51
53a9f2fe79d0 Added more text.
Tony Graham
parents: 46
diff changeset
    71
</box>
14
f9507e36d645 Added font-size adjustment example.
Tony Graham
parents:
diff changeset
    72
</example>