You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by gr...@apache.org on 2001/01/12 23:23:40 UTC
cvs commit: xml-cocoon/samples/fo novel-fo.xsl test-fo.xml
greenrd 01/01/12 14:23:40
Modified: . changes.xml
samples/fo novel-fo.xsl test-fo.xml
Log:
fixed 2 of 3 fop samples
Revision Changes Path
1.174 +5 -2 xml-cocoon/changes.xml
Index: changes.xml
===================================================================
RCS file: /home/cvs/xml-cocoon/changes.xml,v
retrieving revision 1.173
retrieving revision 1.174
diff -u -r1.173 -r1.174
--- changes.xml 2001/01/12 20:45:16 1.173
+++ changes.xml 2001/01/12 22:23:39 1.174
@@ -4,7 +4,7 @@
<!--
History of Cocoon changes
- $Id: changes.xml,v 1.173 2001/01/12 20:45:16 greenrd Exp $
+ $Id: changes.xml,v 1.174 2001/01/12 22:23:39 greenrd Exp $
-->
<changes title="History of Changes">
@@ -18,7 +18,10 @@
</devs>
<release version="@version@" date="@date@">
- <action dev="RDG" type="add" due-to="michele bianchi" due-to-email="mic@pow2.com">
+ <action dev="RDG" type="fix" due-to="Steve Coffman" due-to-email="SCoffman@CBSInc.com">
+ Fixed first and third XSL:FO examples for FOP 0.15 conformance. Second example still needs fixing.
+ </action>
+ <action dev="RDG" type="add" due-to="Michele Bianchi" due-to-email="mic@pow2.com">
Added installation instructions for Inprise Application Server and Dynamo.
</action>
<action dev="RDG" type="fix">
1.6 +19 -17 xml-cocoon/samples/fo/novel-fo.xsl
Index: novel-fo.xsl
===================================================================
RCS file: /home/cvs/xml-cocoon/samples/fo/novel-fo.xsl,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- novel-fo.xsl 2000/03/01 16:05:33 1.5
+++ novel-fo.xsl 2001/01/12 22:23:39 1.6
@@ -7,7 +7,7 @@
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
<fo:layout-master-set>
<fo:simple-page-master
- page-master-name="right"
+ master-name="right"
margin-top="75pt"
margin-bottom="25pt"
margin-left="100pt"
@@ -16,7 +16,7 @@
<fo:region-after extent="25pt"/>
</fo:simple-page-master>
<fo:simple-page-master
- page-master-name="left"
+ master-name="left"
margin-top="75pt"
margin-bottom="25pt"
margin-left="50pt"
@@ -24,22 +24,24 @@
<fo:region-body margin-bottom="50pt"/>
<fo:region-after extent="25pt"/>
</fo:simple-page-master>
+ <fo:page-sequence-master master-name="psmOddEven">
+ <fo:repeatable-page-master-alternatives>
+ <fo:conditional-page-master-reference master-name="right" page-position="first"/>
+ <fo:conditional-page-master-reference master-name="right" odd-or-even="even"/>
+ <fo:conditional-page-master-reference master-name="left" odd-or-even="odd"/>
+ <!-- recommended fallback procedure -->
+ <fo:conditional-page-master-reference master-name="right"/>
+ </fo:repeatable-page-master-alternatives>
+ </fo:page-sequence-master>
</fo:layout-master-set>
- <fo:page-sequence>
+ <fo:page-sequence master-name="psmOddEven">
- <fo:sequence-specification>
- <fo:sequence-specifier-alternating
- page-master-first="right"
- page-master-odd="right"
- page-master-even="left"/>
- </fo:sequence-specification>
-
- <fo:static-content flow-name="xsl-after">
- <fo:block text-align-last="centered" font-size="10pt"><fo:page-number/></fo:block>
+ <fo:static-content flow-name="xsl-region-after">
+ <fo:block text-align-last="center" font-size="10pt"><fo:page-number/></fo:block>
</fo:static-content>
- <fo:flow>
+ <fo:flow flow-name="xsl-region-body">
<xsl:apply-templates/>
</fo:flow>
</fo:page-sequence>
@@ -48,11 +50,11 @@
</xsl:template>
<xsl:template match="front/title">
- <fo:block font-size="36pt" text-align-last="centered" space-before.optimum="24pt"><xsl:apply-templates/></fo:block>
+ <fo:block font-size="36pt" text-align-last="center" space-before.optimum="24pt"><xsl:apply-templates/></fo:block>
</xsl:template>
<xsl:template match="author">
- <fo:block font-size="24pt" text-align-last="centered" space-before.optimum="24pt"><xsl:apply-templates/></fo:block>
+ <fo:block font-size="24pt" text-align-last="center" space-before.optimum="24pt"><xsl:apply-templates/></fo:block>
</xsl:template>
<xsl:template match="revision-list">
@@ -63,10 +65,10 @@
</xsl:template>
<xsl:template match="chapter/title">
- <fo:block font-size="24pt" text-align-last="centered" space-before.optimum="24pt"><xsl:apply-templates/></fo:block>
+ <fo:block font-size="24pt" text-align-last="center" space-before.optimum="24pt"><xsl:apply-templates/></fo:block>
</xsl:template>
<xsl:template match="paragraph">
- <fo:block font-size="12pt" space-before.optimum="12pt" text-align="justified"><xsl:apply-templates/></fo:block>
+ <fo:block font-size="12pt" space-before.optimum="12pt" text-align="justify"><xsl:apply-templates/></fo:block>
</xsl:template>
</xsl:stylesheet>
1.3 +263 -100 xml-cocoon/samples/fo/test-fo.xml
Index: test-fo.xml
===================================================================
RCS file: /home/cvs/xml-cocoon/samples/fo/test-fo.xml,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- test-fo.xml 1999/12/08 12:29:25 1.2
+++ test-fo.xml 2001/01/12 22:23:39 1.3
@@ -2,109 +2,272 @@
<?cocoon-format type="text/xslfo"?>
-<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
- <fo:layout-master-set>
- <fo:simple-page-master page-master-name="one" margin-left="100pt" margin-right="100pt">
- <fo:region-body margin-top="50pt" margin-bottom="50pt"/>
- </fo:simple-page-master>
- </fo:layout-master-set>
-
- <fo:page-sequence>
- <fo:sequence-specification>
- <fo:sequence-specifier-repeating page-master-first="one" page-master-repeating="one"/>
- </fo:sequence-specification>
-
- <fo:flow font-size="12pt" line-height="12pt">
-
- <fo:block text-align="centered" font-size="24pt" line-height="28pt">Welcome
- to Cocoon</fo:block>
+<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"
+xmlns:svg="http://www.w3.org/2000/svg">
+<fo:layout-master-set>
+<fo:simple-page-master master-name="one">
+<fo:region-body margin-top="50pt" margin-bottom="50pt"
+margin-left="100pt" margin-right="100pt"/>
+</fo:simple-page-master>
+</fo:layout-master-set>
+<fo:page-sequence master-name="one">
+<fo:flow flow-name="xsl-region-body">
+<fo:block>A Block</fo:block>
+<fo:block text-align="end">An End Aligned Block</fo:block>
+<fo:block text-align="center">A Centered Block</fo:block>
+<fo:block>This is a multiple line block that extends over more than one
+line. There should be appropriate line breaks. Alignment is
+default.</fo:block>
+<fo:block text-align="end">This is a multiple line block that extends
+over more than one line. There should be appropriate line breaks.
+Alignment is end.</fo:block>
+<fo:block text-align="center">This is a multiple line block that
+extends over more than one line. There should be appropriate line
+breaks. Alignment is centered.</fo:block>
+<fo:block text-align="justify">This is a multiple line block that
+extends over more than one line. There should be appropriate line
+breaks. I'm going to keep going so I can get three lines to check how
+all but the last justify. There, that should do it. Alignment is
+justified.</fo:block>
+<fo:block>A block for comparison</fo:block>
+<fo:block space-before.optimum="12pt">A block with 12pt
+space-before</fo:block>
+<fo:block>A block for comparison</fo:block>
+<fo:block space-after.optimum="12pt">A block with 12pt
+space-after</fo:block>
+<fo:block>A block for comparison</fo:block>
+<fo:block space-before.optimum="12pt" space-after.optimum="12pt">A
+block with both 12pt space-before and space-after</fo:block>
+<fo:block>A block for comparison</fo:block>
+<fo:block start-indent="50pt">This is a multiple line block that
+extends over more than one line. There should be appropriate line
+breaks. There is a start-indent of 50pt.</fo:block>
+<fo:block end-indent="50pt">This is a multiple line block that
+extends over more than one line. There should be appropriate line
+breaks. There is an end-indent of 50pt.</fo:block>
+<fo:block start-indent="50pt" end-indent="50pt">This is a multiple
+line block that extends over more than one line. There should be
+appropriate line breaks. There is a start-indent and end-indent of
+50pt.</fo:block>
+<fo:block font-size="15pt">This is a multiple line block that extends
+over more than one line. There should be appropriate line breaks. The
+font-size is set to 15pt.</fo:block>
+<fo:block line-height="20pt">This is a multiple line block that
+extends over more than one line. There should be appropriate line
+breaks. The line-height is set to 20pt.</fo:block>
+<fo:block font-size="15pt" line-height="20pt">This is a multiple
+line block that extends over more than one line. There should be
+appropriate line breaks. The font-size is set to 15pt and the
+line-height is set to 20pt.</fo:block>
+<fo:block font-size="15pt" line-height="15pt">This is a multiple
+line block that extends over more than one line. There should be
+appropriate line breaks. The font-size is set to 15pt and the
+line-height is set to 15pt.</fo:block>
+<fo:block space-before.optimum="12pt"
+space-after.optimum="12pt"><fo:block space-before.optimum="12pt"
+space-after.optimum="12pt">A block within a
+block</fo:block></fo:block>
+<fo:block space-before.optimum="12pt"
+space-after.optimum="12pt">Text before<fo:block
+space-before.optimum="12pt" space-after.optimum="12pt">A block
+within a block</fo:block>Text after</fo:block>
+<fo:block space-before.optimum="12pt" space-after.optimum="12pt"
+start-indent="50pt">Text before<fo:block
+space-before.optimum="12pt" space-after.optimum="12pt">A block
+within a block with 50pt start-intent</fo:block>Text after</fo:block>
+<fo:block space-before.optimum="12pt" space-after.optimum="12pt"
+start-indent="50pt">And again for the page break, text
+before<fo:block space-before.optimum="12pt"
+space-after.optimum="12pt">A block within a block with 50pt
+start-intent</fo:block>Text after</fo:block>
+<fo:block space-before.optimum="12pt" space-after.optimum="12pt"
+start-indent="50pt">Text before<fo:block
+space-before.optimum="12pt" space-after.optimum="12pt">A block with
+50pt start-indent within a block with 50pt start-intent</fo:block>Text
+after</fo:block>
+<fo:block space-before.optimum="12pt" space-after.optimum="12pt"
+start-indent="50pt">Text before<fo:block
+space-before.optimum="12pt" space-after.optimum="12pt"
+start-indent="100pt">A block with 100pt start-indent within a block
+with 50pt start-intent</fo:block>Text after</fo:block>
+<fo:list-block provisional-distance-between-starts="12pt"
+space-before.optimum="12pt" text-align="justify">
+<fo:list-item>
+<fo:list-item-label><fo:block>•</fo:block></fo:list-item-label>
+<fo:list-item-body><fo:block>This is a multiple line block that extends
+over more than one line. There should be appropriate line
+breaks.</fo:block></fo:list-item-body>
+</fo:list-item>
+<fo:list-item>
+<fo:list-item-label><fo:block>•</fo:block></fo:list-item-label>
+<fo:list-item-body><fo:block>This is a multiple line block that extends
+over more than one line. There should be appropriate line
+breaks.</fo:block><fo:block>This is a multiple line block that extends
+over more than one line. There should be appropriate line
+breaks.</fo:block><fo:block>This is a multiple line block that extends
+over more than one line. There should be appropriate line
+breaks.</fo:block></fo:list-item-body>
+</fo:list-item>
+</fo:list-block>
+<fo:list-block start-indent="50pt"
+provisional-distance-between-starts="12pt"
+space-before.optimum="12pt" text-align="justify">
+<fo:list-item>
+<fo:list-item-label><fo:block>•</fo:block></fo:list-item-label>
+<fo:list-item-body><fo:block>This is a multiple line block that extends
+over more than one line. There should be appropriate line breaks. The
+list-block has a start-indent of 50pt and a text-align of
+justified.</fo:block></fo:list-item-body>
+</fo:list-item>
+<fo:list-item>
+<fo:list-item-label><fo:block>•</fo:block></fo:list-item-label>
+<fo:list-item-body><fo:block>This is a multiple line block that extends
+over more than one line. There should be appropriate line
+breaks.</fo:block><fo:block>This is a second multiple line block that
+extends over more than one line. There should be appropriate line
+breaks.</fo:block><fo:block>This is a third multiple line block that
+extends over more than one line. There should be appropriate line
+breaks.</fo:block></fo:list-item-body>
+</fo:list-item>
+</fo:list-block>
+<fo:list-block provisional-distance-between-starts="12pt"
+space-before.optimum="12pt" text-align="justify">
+<fo:list-item>
+<fo:list-item-label><fo:block>•</fo:block></fo:list-item-label>
+<fo:list-item-body><fo:block>This is a multiple line block that extends
+over more than one line. There should be appropriate line
+breaks.</fo:block><fo:block start-indent="100pt">This is a multiple
+line block with start-indent 100pt that extends over more than one
+line. There should be appropriate line breaks.</fo:block><fo:block>This
+is a multiple line block that extends over more than one line. There
+should be appropriate line breaks.</fo:block></fo:list-item-body>
+</fo:list-item>
+<fo:list-item>
+<fo:list-item-label><fo:block>•</fo:block></fo:list-item-label>
+<fo:list-item-body><fo:block>This is a multiple line block that extends
+over more than one line. There should be appropriate line
+breaks.<fo:block>This is an embedded multiple line block that extends
+over more than one line. There should be appropriate line
+breaks.</fo:block>This is a multiple line block that extends over more
+than one line. There should be appropriate line
+breaks.</fo:block></fo:list-item-body>
+</fo:list-item>
+</fo:list-block>
+ <fo:list-block provisional-distance-between-starts="12pt"
+space-before.optimum="12pt">
+ <fo:list-item>
- <fo:block space-before.optimum="30pt" text-align="justified">This is an
- example of the use of XSL formatting objects rendered in PDF. Cocoon uses
- the Apache FOP project to do this. It is early days, but FOP is increasingly
- supporting more and more formatting objects.</fo:block>
-
- <fo:block text-align="justified" space-before.optimum="30pt">What follows
- is a list:</fo:block>
-
- <fo:list-block space-before.optimum="6pt">
- <fo:list-item space-before.optimum="12pt">
- <fo:list-item-label>
- <fo:block>1.</fo:block>
- </fo:list-item-label>
- <fo:list-item-body>
- <fo:block text-align="justified">This is item one. It is going to go
- for a little longer to see if this list-item-body correctly wraps.
- There, that should be enough.</fo:block>
- </fo:list-item-body>
- </fo:list-item>
+<fo:list-item-label><fo:block>•</fo:block></fo:list-item-label>
+ <fo:list-item-body><fo:block>A block in a
+list-item-body</fo:block></fo:list-item-body>
+ </fo:list-item>
+ <fo:list-item>
- <fo:list-item space-before.optimum="12pt">
- <fo:list-item-label>
- <fo:block>2.</fo:block>
- </fo:list-item-label>
- <fo:list-item-body>
- <fo:block text-align="justified">This is item two. It has two blocks in
- the body. This is the first.</fo:block>
- <fo:block text-align="justified" space-before.optimum="6pt">This is the second.</fo:block>
- </fo:list-item-body>
- </fo:list-item>
-
- <fo:list-item space-before.optimum="12pt">
- <fo:list-item-label>
- <fo:block>3.</fo:block>
- </fo:list-item-label>
- <fo:list-item-body>
- <fo:block text-align="justified">This is item three.</fo:block>
- </fo:list-item-body>
- </fo:list-item>
- </fo:list-block>
+<fo:list-item-label><fo:block>•</fo:block></fo:list-item-label>
+ <fo:list-item-body>
+ <fo:list-block
+provisional-distance-between-starts="12pt">
+ <fo:list-item>
- <fo:block text-align="justified" space-before.optimum="30pt">Now a table:</fo:block>
-
- <fo:table space-before.optimum="6pt" text-align="centered">
- <fo:table-column column-width="150pt"/>
- <fo:table-column column-width="150pt"/>
- <fo:table-body>
- <fo:table-row space-before.optimum="6pt">
- <fo:table-cell>
- <fo:block>Cell (1,1)</fo:block>
- </fo:table-cell>
- <fo:table-cell>
- <fo:block>Cell (1,2)</fo:block>
- </fo:table-cell>
- </fo:table-row>
- <fo:table-row space-before.optimum="6pt">
- <fo:table-cell>
- <fo:block>Cell (2,1)</fo:block>
- </fo:table-cell>
- <fo:table-cell>
- <fo:block>Cell (2,2)</fo:block>
- </fo:table-cell>
- </fo:table-row>
- <fo:table-row space-before.optimum="6pt">
- <fo:table-cell>
- <fo:block>Cell (3,1)</fo:block>
- </fo:table-cell>
- <fo:table-cell>
- <fo:block>Cell (3,2)</fo:block>
- </fo:table-cell>
- </fo:table-row>
- </fo:table-body>
- </fo:table>
-
- <fo:block text-align="justified" space-before.optimum="30pt">This is a
- text paragraph. This paragraph has to be long enough that it wraps so I
- can test out text-align. That means I have to keep going and going until
- I get at least a few lines to play with. I wonder if that's enough. Let
- me go and check. Yep.</fo:block>
-
- <!-- <fo:display-graphic href="c:\cocoon.jpg"/> -->
-
- </fo:flow>
-
- </fo:page-sequence>
-
+<fo:list-item-label><fo:block>•</fo:block></fo:list-item-label>
+ <fo:list-item-body><fo:block>This is a list item in a
+list that is itself a list item</fo:block></fo:list-item-body>
+ </fo:list-item>
+ </fo:list-block>
+ </fo:list-item-body>
+ </fo:list-item>
+ </fo:list-block>
+ <fo:block break-before="page" font-size="24pt"
+line-height="28pt" space-before.optimum="12pt"
+space-after.optimum="12pt">Next Stage</fo:block>
+ <fo:block>Right, now we are ready to try some newly implemented
+things like rules. What follows is a display rule of default thickness
+1pt and a space-before and space-after of 12pt.</fo:block>
+ <fo:block><fo:leader leader-pattern="rule"
+space-before.optimum="12pt" space-after.optimum="12pt"/></fo:block>
+ <fo:block>Now what follows is a leader of thickness 5pt with
+start-indent of 100pt (same space-before/after as before).</fo:block>
+ <fo:block><fo:leader leader-pattern="rule"
+space-before.optimum="12pt" space-after.optimum="12pt"
+rule-thickness="5pt" start-indent="100pt"/></fo:block>
+ <fo:block font-size="24pt" line-height="28pt"
+space-before.optimum="12pt" space-after.optimum="12pt"
+ ><fo:inline color="#500">C</fo:inline
+ ><fo:inline color="#700">o</fo:inline
+ ><fo:inline color="#900">l</fo:inline
+ ><fo:inline color="#B00">o</fo:inline
+ ><fo:inline color="#D00">u</fo:inline
+ ><fo:inline color="#F00">r</fo:inline
+ ></fo:block>
+ <fo:block color="black">black</fo:block>
+ <fo:block color="green">green</fo:block>
+ <fo:block color="silver">silver</fo:block>
+ <fo:block color="lime">lime</fo:block>
+ <fo:block color="gray">gray</fo:block>
+ <fo:block color="olive">olive</fo:block>
+ <fo:block color="white">white</fo:block>
+ <fo:block color="yellow">yellow</fo:block>
+ <fo:block color="maroon">maroon</fo:block>
+ <fo:block color="navy">navy</fo:block>
+ <fo:block color="red">red</fo:block>
+ <fo:block color="blue">blue</fo:block>
+ <fo:block color="purple">purple</fo:block>
+ <fo:block color="teal">teal</fo:block>
+ <fo:block color="fuchsia">fuchsia</fo:block>
+ <fo:block color="aqua">aqua</fo:block>
+ <fo:block break-before="even-page" font-size="24pt"
+line-height="28pt" space-before.optimum="12pt"
+space-after.optimum="12pt">Wrap</fo:block>
+ <fo:block space-before.optimum="12pt">This is a rather long
+sentence that is going to keep on going and going, not really to
+demonstrate anything other that normal wrapping because the following
+paragraph will show what happens when wrap-option is set to
+no-wrap.</fo:block>
+ <fo:block space-before.optimum="12pt"
+wrap-option="no-wrap">This is a rather long sentence that is going to
+keep on going and going to demonstrate what happens when wrap-option is
+set to no-wrap which is unlike the preceding sentence where it defaults
+to wrap.</fo:block>
+ <fo:block space-before.optimum="12pt" wrap-option="wrap">This
+is a rather long sentence that is going to keep on going and going, not
+really to demonstrate anything other that normal wrapping but it
+differs from the first of these three sentences in that wrap is set
+explicitly.</fo:block>
+ <fo:block font-size="24pt" line-height="28pt"
+space-before.optimum="12pt" space-after.optimum="12pt">White Space
+Collapse</fo:block>
+<fo:block>This is default!</fo:block>
+<fo:block white-space-collapse="false">This is
+false!</fo:block>
+<fo:block white-space-collapse="true">This is
+true!</fo:block>
+<fo:block font-family="monospace" white-space-collapse="false">
+<![CDATA[
+<?xml version="1.0"?>
+<document>
+ <heading>This is a heading</heading>
+ <list>
+ <item>Item one</item>
+ <item>Item two</item>
+ </list>
+</document>
+]]>
+</fo:block>-->
+ <fo:block break-before="page" font-size="24pt"
+line-height="28pt" space-before.optimum="12pt"
+space-after.optimum="12pt">Embedded SVG</fo:block>
+ <fo:block><fo:instream-foreign-object>
+ <svg:svg width="400pt" height="200pt">
+ <svg:rect x="20pt" y="20pt" width="100pt"
+height="100pt"/>
+ <svg:line x1="20pt" y1="20pt" x2="120pt" y2="120pt"/>
+ <svg:line x1="120pt" y1="20pt" x2="20pt" y2="120pt"/>
+ <svg:text x="20pt" y="150pt">Hello SVG!</svg:text>
+ </svg:svg>
+ </fo:instream-foreign-object></fo:block>
+ <fo:block>The above is an example of an SVG graphic</fo:block>
+ </fo:flow>
+ </fo:page-sequence>
</fo:root>