[Wh2fo-devel] Getting familiarized and more
Status: Beta
Brought to you by:
fabgia
From: Carlos N. <cc...@ho...> - 2002-01-10 11:46:11
|
Hi Nachev, Matthias and Fabio Well, for now, i'm trying to get more and more familiarized with the code, and trying to develop a servlet like FopServlet that helps you to get a pdf from a word2000-html file instead of fo file. The basic steps will be: 1) Get a Word2000-Html ready for dynamic data (below is Fabio's mail at 'wh2...@li...' about this). 2) Get a xml fed up with the data. 3) Get the wh2fo's xml, xsl and AttsXsl with wh2fo from 1) 4) Get the fo with xalan from 2) and 3) 5) Get the pdf with fop from 4) Step 5) is the original FopServlet (at Fop-0.20.1\docs\examples\advanced) Step 2) is just build a dom object with data from a bean or directly from database. Step 1) requires to define some extra styles that will be replaced by means of an extra xslt. Step 3) requires to wrap som classes that prodece that extra xsl and the <xsl:import href...> at the wh2fo original xsl. Step 4) is a simple transformation. Well just step 4), the easier, is putting me in trouble, due to the <xsl:apply-templates select="document('Tables.xml')...>, i think. If the transform process cannot find the file Tables.xml (from the wh2fo examples distribution), it generates an incomplete fo file. If it find it the transform process never end. Any idea? Any suggestions? Thanks, Carlos >You could do even more. If inside Word you define special styles such as >CustomerName, CustomerAddress and so on, then you can replate them from the >XSL-T file generated by WH2FO with the correct: ><xsl:apply-templates select="document('customers.xml') > //customers/customer/personal/name" /> and get the dynamic content. >So when someone is asking the pdf file you could execute the modified > >XSL-T and get an FO file to be rendered using FOP. >Alternatevely you can import an external XSL-T file that "overrides" >the templates that contains the dynamic content expressing an high priority >to the imported ones (a very elegant solution :-)) )... I will try to > >explain myself with an example: > >WH2FO XSL-T file > >.. ><xsl:import href="dyncont.xsl"/> >.. >.. ><xsl:template match="paragraph[@class='CustomerName'] ...> >... ></xsl:template> > > >dyncont.xsl > >.. ><xsl:template match="paragraph[@class='CustomerName']" priority="1" > <xsl:apply-templates select="document('customers.xml') > //customers/customer/personal/name" /> ></xsl:template> >.. > _________________________________________________________________ Con MSN Hotmail súmese al servicio de correo electrónico más grande del mundo. http://www.hotmail.com/ES |