xmlgraphics-fop-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From RithanyaLaxmi <anantharaman.muru...@atlassystems.com>
Subject Re: Populating data dynamically from the DB using Apache FOP
Date Thu, 11 Feb 2010 09:30:29 GMT

Thanks Simon, as per your comment i need to parse the Temp.xml (which
contains the placeholder) using SAX and read the data from the resultset.
But how can I merge or append the data reed from DB to the Temp.xml.
Once i merge the data in place of the placeholder, the temp.xml should look
like:-


<bodyContent>
blahhhhhhhhh... // fetched from db
</bodycontent>

I am pretty new to this, please provide the sampled code for this. If there
is any links related to this those are welcome as well.

Thanks,
Rithu

Simon Pepping @ Home wrote:
> 
> You can use SAX. Your app implements SAXParser and emits SAX events:
> 
> contentHandler.startElement('header');
> contentHandler.text('Sample Header');
> 
> etc. Similarly for your data from the DB. For example, read the
> ResultSet, and emit the appropriate SAX events. The total picture is
> then:
> 
> data (SAXParser) -> Transformer (temp.xsl) -> SAXResult (FOP)
> 
> Simon
> 
> On Wed, Feb 10, 2010 at 11:05:03PM -0800, RithanyaLaxmi wrote:
>> 
>> Hi,
>> 
>> I using Apache FOP for PDF generation, i have the XML with header and
>> footer
>> information in the bodycontent i have a placeholder, for eg,
>> 
>> Temp.xml
>> 
>> <header>
>> Sample Header
>> </header>
>> <bodycontent>
>> [[bodycontent to be populated dynamically from DB]]
>> </bodycontent>
>> <footer>
>> Sample Footer
>> </footer>
>> 
>> Temp.xsl,
>> 
>> will have the XSL tags with the layout, styles, etc.
>> 
>> Using Apache FOP API i need to fetch the data from the DB (using
>> javax.sql),
>> and replace the placeholder with the data in it and then use the XSL to
>> apply the styles,etc to generate a PDF?
>> I know the latter, i am not sure how to read the XML and replace the
>> placeholder with the data fetched from DB using apache FOP. I know that
>> Apache FOP uses SAX by default. Please do provide the code to parse the
>> Temp.xml and replace the place holder with data using apache FOP. If
>> there
>> is any sample links please do provide that as well.
> 
> -- 
> Simon Pepping
> home page: http://www.leverkruid.eu
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
> 
> 
> 

-- 
View this message in context: http://old.nabble.com/Populating-data-dynamically-from-the-DB-using-Apache-FOP-tp27542925p27544263.html
Sent from the FOP - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Mime
View raw message