cocoon-docs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From da...@cocoon.zones.apache.org
Subject [DAISY] Updated: Your first XML pipeline (publishing)
Date Mon, 28 May 2007 12:37:36 GMT
A document has been updated:

http://cocoon.zones.apache.org/daisy/documentation/1290.html

Document ID: 1290
Branch: main
Language: default
Name: Your first XML pipeline (publishing) (unchanged)
Document Type: Cocoon Document (unchanged)
Updated on: 5/28/07 12:37:20 PM
Updated by: Reinhard Pötz

A new version has been created, state: publish

Parts
=====

Content
-------
This part has been updated.
Mime type: text/xml (unchanged)
File name:  (unchanged)
Size: 10920 bytes (previous version: 8693 bytes)
Content diff:
(173 equal lines skipped)
          <map:match pattern="myThirdPipeline">
            <map:generate src="myXmlFile.xml" type="file"/>
    </strong></strong><strong><strong><strong><strong>
       &lt;map:transform src="myXml2PdfFile.xslt" type="xslt"/&gt;</strong></strong></strong></strong>
--- <strong><strong>        &lt;map:serialize type="fop"/&gt;
+++ <strong><strong>        &lt;map:serialize type="fo2pdf"/&gt;
          &lt;/map:match&gt;</strong></strong></strong>
        &lt;/map:pipeline&gt;
        [...]
(5 equal lines skipped)
    myXmlFile.xml to some XML that can be used by
    <a href="http://xmlgraphics.apache.org/fop/">FOP</a> to create PDF:</p>
    
--- <pre>... [put the stylesheet here]</pre>
+++ <pre>&lt;?xml version="1.0"?&gt;
+++ &lt;xsl:stylesheet version="1.0"
+++   xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+++   xmlns:fo="http://www.w3.org/1999/XSL/Format"&gt;
    
+++   &lt;xsl:template match="/"&gt;
+++     &lt;fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"&gt;
+++       &lt;fo:layout-master-set&gt;
+++         &lt;fo:simple-page-master master-name="page"
+++           page-height="29.7cm"
+++           page-width="21cm"
+++           margin-top="1cm"
+++           margin-bottom="2cm"
+++           margin-left="2.5cm"
+++           margin-right="2.5cm"&gt;
+++           &lt;fo:region-before extent="3cm"/&gt;
+++           &lt;fo:region-body margin-top="3cm"/&gt;
+++           &lt;fo:region-after extent="1.5cm"/&gt;
+++         &lt;/fo:simple-page-master&gt;
+++ 
+++         &lt;fo:page-sequence-master master-name="all"&gt;
+++           &lt;fo:repeatable-page-master-alternatives&gt;
+++             &lt;fo:conditional-page-master-reference 
+++              master-reference="page" page-position="first"/&gt;
+++           &lt;/fo:repeatable-page-master-alternatives&gt;
+++         &lt;/fo:page-sequence-master&gt;
+++       &lt;/fo:layout-master-set&gt;
+++ 
+++       &lt;fo:page-sequence master-reference="all"&gt;
+++         &lt;fo:static-content flow-name="xsl-region-after"&gt;
+++           &lt;fo:block text-align="center"
+++             font-size="10pt"
+++             font-family="serif"
+++             line-height="14pt"&gt;page &lt;fo:page-number/&gt;&lt;/fo:block&gt;
+++         &lt;/fo:static-content&gt;
+++ 
+++         &lt;fo:flow flow-name="xsl-region-body"&gt;
+++           &lt;fo:block font-size="36pt" space-before.optimum="24pt" 
+++            text-align="center"&gt;
+++              My second XML Pipeline
+++           &lt;/fo:block&gt;
+++           &lt;fo:block font-size="12pt" space-before.optimum="12pt" 
+++            text-align="center"&gt;
+++            &lt;xsl:value-of select="/content"/&gt;
+++           &lt;/fo:block&gt;
+++         &lt;/fo:flow&gt;
+++       &lt;/fo:page-sequence&gt;
+++     &lt;/fo:root&gt;
+++   &lt;/xsl:template&gt;
+++ &lt;/xsl:stylesheet&gt;</pre>
+++ 
    <p>You also have to use a different serializer for this example, a serializer
    that can use the XML created by the stylesheet and produce PDF based on it.
    Cocoon ships this serializer as part of the FOP block. Since the block that you
    created probably doesn't have the FOP block added as dependency, this has to be
    done before you can test your pipeline. Adding a block requires editing the
    pom.xml of your block:</p>
    
--- <pre>... [put the pom.xml here]</pre>
+++ <pre>  &lt;dependencies&gt;
+++     [...]
+++     &lt;dependency&gt;
+++       &lt;groupId&gt;<strong>org.apache.cocoon</strong>&lt;/groupId&gt;
+++       &lt;artifactId&gt;<strong>cocoon-fop-impl</strong>&lt;/artifactId&gt;
+++       &lt;version&gt;<strong>1.0.0-RC1</strong>&lt;/version&gt;
+++     &lt;/dependency&gt;
+++     [...]
+++   &lt;/dependencies&gt;</pre>
    
--- <p>Rebuild your block:</p>
+++ <p>Rebuild your block</p>
    
    <pre>mvn compile</pre>
    
(10 equal lines skipped)


Mime
View raw message