xsl-fo-pdf

Subject: xsl-fo-pdf
From: "Geeta Gudavalli" <ggudavalli@xxxxxxxxxxxxx>
Date: Fri, 1 Dec 2000 14:09:25 -0600


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




 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread