xmlgraphics-fop-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Volker.Reichel" <Volker.Reic...@freenet.de>
Subject AW: xsl-fo-pdf
Date Sat, 02 Dec 2000 09:24:35 GMT
Hello Geeta,


what's the exact contents of your XSL file?
Is <xsl:template match="/"> your one and only template?
If so <xsl:apply-templates select="DSR"/> will try to apply all existing
templates (the ones in your xsl file AND the built-in ones of the XSLT
processor)
which will produce some text that is not embedded in fo-tags.
And then the section starting with <fo:root.....> will be put into your
output file.
So the structure of the output file should look like:

1. section: all data from your xml file
2. section: <fo:root ... </fo:root>


> -----Urspr√ľngliche Nachricht-----
> Von: Geeta Gudavalli [mailto:ggudavalli@McLeodUSA.com]
> Gesendet am: Samstag, 2. Dezember 2000 00:31
> An: fop-dev@xml.apache.org
> Betreff: xsl-fo-pdf
>
>
>
> Hello everyone,
>      I have two questions regarding transforming XML to PDF.
> 1.  I get data from db2 as xml format.  This file has different
> templates in it.
> When I transform this to pdf, I am getting error at FOP rendering
> because the
> xsl file does not just choose the template I specify.  It picks
> up all the data
> from the file.  This causes fop to error out.  The e sample xml
> file is given
> below.  Can someone help me figure out how to select only one
> template at a time
> with out parsing the xml file to break it into different files.
> Sample of my xsl and xml files"
> XSL FILE
> <?xml version='1.0'?>
> <xsl:stylesheet
>      xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version='1.0'
>      xmlns:fo="http://www.w3.org/1999/XSL/Format">
>      <!--xsl:output method="fop:org.apache.fop.apps.PDFOutputHandler"-->
> >
> <xsl:template match="/">
>  <xsl:apply-templates select="DSR"/>
>    <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
>      <fo:layout-master-set>
>         <fo:simple-page-master
>             margin-right="4.0cm"
>             margin-bottom="4.5cm"
>             margin-top="0cm"
>             page-width="28cm"
>             page-height="21.5cm"
>             page-master-name="dirser1">
>           <fo:region-body>
>            </fo:region-body>
>         </fo:simple-page-master>
>       </fo:layout-master-set>
>       <fo:page-sequence>
>         <fo:sequence-specification>
>             <fo:sequence-specifier-repeating
>                 page-master-repeating="dirser1"
>                 page-master-first="dirser1">
>          </fo:sequence-specifier-repeating>
>        </fo:sequence-specification>
>        <fo:flow flow-name="xsl-body">
>             <fo:block-container
>                 height="1.5cm"
>                  width="7.0cm"
>               top="2.5cm"
>                  left="10.0cm"
>               position="absolute">
>              <fo:block text-align="centered"
>                  font-family="TimesRoman"
>                  font-size="16pt"
>                  font-weight="bold">
>                     Directory Service Request
>                 </fo:block>
>             </fo:block-container>
>             <fo:block-container
>                 height=".5cm"
>                  width="21cm"
>               top="3.0cm"
>                  left="2.8cm"
>               position="absolute">
>                  <fo:block>
>                     <fo:inline-sequence>
>                          <fo:display-rule rule-thickness="2pt"
> length="15cm"
> rule-style="solid"/>
>                     </fo:inline-sequence>
>                 </fo:block>
>            </fo:block-container>
>           <fo:block-container
>                 height="1.0cm"
>                  width="5.5cm"
>               top="3.3cm"
>                  left="2.8cm"
>               position="absolute">
>              <fo:block text-align="start"
>                  font-family="sans-serif"
>                  font-size="10pt"
>                  font-weight="bold">
>                     Administrative Section
>                 </fo:block>
>             </fo:block-container>
>             <fo:block-container
>                 height=".5cm"
>                  width="21cm"
>               top="3.7cm"
>                  left="2.8cm"
>               position="absolute">
>                  <fo:block>
>                     <fo:inline-sequence>
>                          <fo:display-rule rule-thickness="1pt"
> rule-style="solid"/>
>                     </fo:inline-sequence>
>                 </fo:block>
>            </fo:block-container>
>           <fo:block-container
>               height=".5cm"
>               width=".7cm"
>               top="3.7cm"
>               left="2.8cm"
>               position="absolute">
>              <fo:block text-align="start" font-family="sans-serif"
> font-size="8pt">
>                          CCNA
>                </fo:block>
>                <fo:block text-align="start" space-before.optimum=".2cm">
>                     <fo:display-rule rule-thickness=".6pt"
> rule-style="solid"/>
>                </fo:block>
>             </fo:block-container>
>           <fo:block-container
>               height=".5cm"
>               width=".7cm"
>               top="4cm"
>               left="2.8cm"
>               position="absolute">
>                <fo:block text-align="start" font-size="8pt" >
>                      <xsl:apply-templates select="ccna"/>
>               </fo:block>
>           </fo:block-container>
>           <fo:block-container
>               height=".5cm"
>               width="4.3cm"
>               top="3.7cm"
>               left="3.7cm"
>               position="absolute">
>              <fo:block text-align="start" font-family="sans-serif"
> font-size="8pt">
>                     PON
>                 </fo:block>
>                 <fo:block text-align="start" space-before.optimum=".2cm">
>                     <fo:display-rule rule-thickness=".6pt"
> rule-style="solid"/>
>                 </fo:block>
>             </fo:block-container>
>
> XML FILE
>   <DSR>
>     <pon>5028</pon>
>     <pon-version>01</pon-version>
>     <mtn>3097648504</mtn>
>     <account-number>3097648504</account-number>
>     <account-tn></account-tn>
>     <ccna>AAA</ccna>
>     <as-pon>5028</as-pon>
>     <as-pon-version>01</as-pon-version>
>     <dsr-no></dsr-no>
>     <location-quantity>001</location-quantity>
>     <as-account-num>3097648504</as-account-num>
>     <as-account-tn></as-account-tn>
>     <exist-account-num></exist-account-num>
>     <exist-account-tn></exist-account-tn>
>     <service-center1></service-center1>
>     <service-center2></service-center2>
>     <date-time-sent>20000302115356</date-time-sent>
>     <exp-due-date>20010101</exp-due-date>
>     <completion-date>20000101</completion-date>
>     <project></project>
>     <da-hot-cut></da-hot-cut>
>     <da-due-time></da-due-time>
>     <requisition-type>H</requisition-type>
>     <requisition-status>B</requisition-status>
>     <activity>C</activity>
>     <supplement-type>0</supplement-type>
>     <expedite-ind></expedite-ind>
>     <response-type>H</response-type>
>     <company-code></company-code>
>     <agency-auth-status></agency-auth-status>
>     <agency-auth-date></agency-auth-date>
>     <agency-auth-name></agency-auth-name>
>     <tos-type>1</tos-type>
>     <tos-product>B</tos-product>
>     <tos-class>G</tos-class>
>     <tos-char>N</tos-char>
>     <dl-order-num />
>     <da-order-num />
>     <related-pon />
>     <related-order-num />
>     <da-related-order-num />
>     <lsp-auth-id />
>     <lsp-auth-date />
>     <lsp-auth-name />
>     <customer-name />
>     <dsr-remarks />
>   </DSR>
>   <SA>
>     <pon>5028</pon>
>     <pon-version>01</pon-version>
>     <mtn>3097648504</mtn>
>     <account-number>3097648504</account-number>
>     <account-tn></account-tn>
>     <address-activity>Z</address-activity>
>     <location-number>003</location-number>
>     <end-user-name>TH AV</end-user-name>
>     <sa-house-no-prefix></sa-house-no-prefix>
>     <sa-house-no>3450</sa-house-no>
>     <sa-house-no-suffix></sa-house-no-suffix>
>     <sa-street-directional></sa-street-directional>
>     <sa-street-name>38th</sa-street-name>
>     <sa-thoroughfare>Av</sa-thoroughfare>
>     <sa-street-suffix></sa-street-suffix>
>     <sa-location></sa-location>
>     <sa-desc-location></sa-desc-location>
>     <sa-community>Moline</sa-community>
>     <sa-state></sa-state>
>     <sa-zip-code>61265</sa-zip-code>
>   </SA>
>
> 2.  How can I run XALAN and FOP interactively from a web page
> rather than a
> batch process?  I do not want to use cocoon?  Is there another way?  I am
> thinking of using Class and method.invoke to invoke the commands.
>
> Your help is greatly appreciated.
> Thank you,
> Geeta
>
>
>
>
>
>


Mime
View raw message