Re: Merging XML and FO files
Hi, Iam using FOP in a similar scenario. As Charles said, its XSLT that you need Please try out the XML/XSL:FO attached. -- Thanks Manjush - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, November 19, 2003 11:59 PM Subject: RE: Merging XML and FO files The instructions at this link (http://xml.apache.org/fop/running.html#standalone-start) seem pretty clear to me. I think the piece you are missing is an XSLT stylesheet to convert your XML to XSL-FO. -- Charles Knell [EMAIL PROTECTED] - email -Original Message- From: Manuel Reyes [EMAIL PROTECTED] Sent: Wed, 19 Nov 2003 17:51:51 - To: [EMAIL PROTECTED] Subject: Merging XML and FO files Hello all, I am currently working on an application that will pull data values from a database and place these into an XML file. The resulting XML file is then to be merged with an FO template file and the result would be used to generate a PDF The reason for the mail, is that I wanted to get opinions on the best way to go about doing this. In my minds eye I have the following idea : XML File (containing data values) : merge_test_report field_values value id=@value1abc - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Merging XML and FO files
That's great, thanks a lot for those files they more or less cover everything I needed to know. One small thing though, due to the nature of the documents I am creating the ability to create intelligent tables is essential. As an example I have a table called foos in which all my foos are listed, the data being held in a database. Now as the total of foos I have increases (or decreases), I will need to regenerate the table (PDF) and this table needs to look professional. So I need something that will allow me to create dynamic tables that will only contain the amount of rows I need to add the details of the foos in the database. I had a look around on http://www-106.ibm.com/developerworks/xml/ I found some information about basic merging, but nothing on dynamic merges. -Original Message- From: Manjush G. Menon [mailto:[EMAIL PROTECTED] Sent: 20 November 2003 06:45 To: [EMAIL PROTECTED] Subject: Fw: Merging XML and FO files Iam sorry the about the missed attachment. -- Manjush G Menon/\ASCII Ribbon Campaign [EMAIL PROTECTED] \ /Respect for open standards FSC Consultant X No HTML/RTF in email FSC SGB Governing body member / \No M$ Word docs in email - Original Message - From: Manjush G. Menon [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, November 20, 2003 9:18 AM Subject: Re: Merging XML and FO files Hi, Iam using FOP in a similar scenario. As Charles said, its XSLT that you need Please try out the XML/XSL:FO attached. -- Thanks Manjush - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, November 19, 2003 11:59 PM Subject: RE: Merging XML and FO files The instructions at this link (http://xml.apache.org/fop/running.html#standalone-start) seem pretty clear to me. I think the piece you are missing is an XSLT stylesheet to convert your XML to XSL-FO. -- Charles Knell [EMAIL PROTECTED] - email -Original Message- From: Manuel Reyes [EMAIL PROTECTED] Sent: Wed, 19 Nov 2003 17:51:51 - To: [EMAIL PROTECTED] Subject: Merging XML and FO files Hello all, I am currently working on an application that will pull data values from a database and place these into an XML file. The resulting XML file is then to be merged with an FO template file and the result would be used to generate a PDF The reason for the mail, is that I wanted to get opinions on the best way to go about doing this. In my minds eye I have the following idea : XML File (containing data values) : merge_test_report field_values value id=@value1abc - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Merging XML and FO files
For anybody who may be searching this list in trying to find the answers to the questions I am asking, this is how it is done : XML File : repeater tubby nameDipsy/name colourGreen/colour /tubby tubby nameLaalaa/name colourRed/colour /tubby tubby namePo/name colourPurple/colour /tubby /repeater XSL File : xsl:for-each select=repeater/tubby fo:block Name : xsl:value-of select=name/ / Colour : xsl:value-of select=colour/ /fo:block /xsl:for-each This will generate the following pdf : Name : Dipsy / Colour : Green Name : Laalaa / Colour : Red Name : Po / Colour : Purple Once again thanks to all those who replied -Original Message- From: Manuel Reyes Sent: 20 November 2003 11:36 To: [EMAIL PROTECTED] Subject: RE: Merging XML and FO files That's great, thanks a lot for those files they more or less cover everything I needed to know. One small thing though, due to the nature of the documents I am creating the ability to create intelligent tables is essential. As an example I have a table called foos in which all my foos are listed, the data being held in a database. Now as the total of foos I have increases (or decreases), I will need to regenerate the table (PDF) and this table needs to look professional. So I need something that will allow me to create dynamic tables that will only contain the amount of rows I need to add the details of the foos in the database. I had a look around on http://www-106.ibm.com/developerworks/xml/ I found some information about basic merging, but nothing on dynamic merges. -Original Message- From: Manjush G. Menon [mailto:[EMAIL PROTECTED] Sent: 20 November 2003 06:45 To: [EMAIL PROTECTED] Subject: Fw: Merging XML and FO files Iam sorry the about the missed attachment. -- Manjush G Menon/\ASCII Ribbon Campaign [EMAIL PROTECTED] \ /Respect for open standards FSC Consultant X No HTML/RTF in email FSC SGB Governing body member / \No M$ Word docs in email - Original Message - From: Manjush G. Menon [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, November 20, 2003 9:18 AM Subject: Re: Merging XML and FO files Hi, Iam using FOP in a similar scenario. As Charles said, its XSLT that you need Please try out the XML/XSL:FO attached. -- Thanks Manjush - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, November 19, 2003 11:59 PM Subject: RE: Merging XML and FO files The instructions at this link (http://xml.apache.org/fop/running.html#standalone-start) seem pretty clear to me. I think the piece you are missing is an XSLT stylesheet to convert your XML to XSL-FO. -- Charles Knell [EMAIL PROTECTED] - email -Original Message- From: Manuel Reyes [EMAIL PROTECTED] Sent: Wed, 19 Nov 2003 17:51:51 - To: [EMAIL PROTECTED] Subject: Merging XML and FO files Hello all, I am currently working on an application that will pull data values from a database and place these into an XML file. The resulting XML file is then to be merged with an FO template file and the result would be used to generate a PDF The reason for the mail, is that I wanted to get opinions on the best way to go about doing this. In my minds eye I have the following idea : XML File (containing data values) : merge_test_report field_values value id=@value1abc - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Merging XML and FO files
You could have also done it like xsl:template match=repeater xsl:apply-templates select=tubby/ /xsl:template xsl:template match=tubby fo:block Name : xsl:value-of select=name/ / Colour : xsl:value-of select=colour/ /fo:block /xsl:template -Original Message- From: Manuel Reyes [mailto:[EMAIL PROTECTED] Sent: 20 November, 2003 12:08 To: [EMAIL PROTECTED] Subject: RE: Merging XML and FO files For anybody who may be searching this list in trying to find the answers to the questions I am asking, this is how it is done : XML File : repeater tubby nameDipsy/name colourGreen/colour /tubby tubby nameLaalaa/name colourRed/colour /tubby tubby namePo/name colourPurple/colour /tubby /repeater XSL File : xsl:for-each select=repeater/tubby fo:block Name : xsl:value-of select=name/ / Colour : xsl:value-of select=colour/ /fo:block /xsl:for-each This will generate the following pdf : Name : Dipsy / Colour : Green Name : Laalaa / Colour : Red Name : Po / Colour : Purple Once again thanks to all those who replied -Original Message- From: Manuel Reyes Sent: 20 November 2003 11:36 To: [EMAIL PROTECTED] Subject: RE: Merging XML and FO files That's great, thanks a lot for those files they more or less cover everything I needed to know. One small thing though, due to the nature of the documents I am creating the ability to create intelligent tables is essential. As an example I have a table called foos in which all my foos are listed, the data being held in a database. Now as the total of foos I have increases (or decreases), I will need to regenerate the table (PDF) and this table needs to look professional. So I need something that will allow me to create dynamic tables that will only contain the amount of rows I need to add the details of the foos in the database. I had a look around on http://www-106.ibm.com/developerworks/xml/ I found some information about basic merging, but nothing on dynamic merges. -Original Message- From: Manjush G. Menon [mailto:[EMAIL PROTECTED] Sent: 20 November 2003 06:45 To: [EMAIL PROTECTED] Subject: Fw: Merging XML and FO files Iam sorry the about the missed attachment. -- Manjush G Menon/\ASCII Ribbon Campaign [EMAIL PROTECTED] \ /Respect for open standards FSC Consultant X No HTML/RTF in email FSC SGB Governing body member / \No M$ Word docs in email - Original Message - From: Manjush G. Menon [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, November 20, 2003 9:18 AM Subject: Re: Merging XML and FO files Hi, Iam using FOP in a similar scenario. As Charles said, its XSLT that you need Please try out the XML/XSL:FO attached. -- Thanks Manjush - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, November 19, 2003 11:59 PM Subject: RE: Merging XML and FO files The instructions at this link (http://xml.apache.org/fop/running.html#standalone-start) seem pretty clear to me. I think the piece you are missing is an XSLT stylesheet to convert your XML to XSL-FO. -- Charles Knell [EMAIL PROTECTED] - email -Original Message- From: Manuel Reyes [EMAIL PROTECTED] Sent: Wed, 19 Nov 2003 17:51:51 - To: [EMAIL PROTECTED] Subject: Merging XML and FO files Hello all, I am currently working on an application that will pull data values from a database and place these into an XML file. The resulting XML file is then to be merged with an FO template file and the result would be used to generate a PDF The reason for the mail, is that I wanted to get opinions on the best way to go about doing this. In my minds eye I have the following idea : XML File (containing data values) : merge_test_report field_values value id=@value1abc - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --- - Visit our Internet site at http://www.reuters.com Get closer to the financial markets with Reuters Messaging - for more information and to register, visit http://www.reuters.com/messaging Any views expressed in this message are those of the individual sender, except where the sender specifically states them to be the views of Reuters Ltd. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL
RE: Merging XML and FO files
That's an interesting way of doing this, and will probably come in handy for the documents I need to produce. Thanks a lot. To get the code to work I needed to change this slightly: xsl:template match=repeater xsl:apply-templates select=tubby/ /xsl:template xsl:template match=tubby fo:block Name : xsl:value-of select=repeater/tubby/name/ / Colour : xsl:value-of select=repeater/tubby/colour/ /fo:block /xsl:template What I did find is that this only prints the first tubby value found inside data/repeater. Is there a way to get all the values (I did notice that I could use for-each inside the xsl:template to do this) Regards Manuel -Original Message- From: Chris Adams [mailto:[EMAIL PROTECTED] Sent: 20 November 2003 12:11 To: [EMAIL PROTECTED] Subject: RE: Merging XML and FO files You could have also done it like xsl:template match=repeater xsl:apply-templates select=tubby/ /xsl:template xsl:template match=tubby fo:block Name : xsl:value-of select=name/ / Colour : xsl:value-of select=colour/ /fo:block /xsl:template -Original Message- From: Manuel Reyes [mailto:[EMAIL PROTECTED] Sent: 20 November, 2003 12:08 To: [EMAIL PROTECTED] Subject: RE: Merging XML and FO files For anybody who may be searching this list in trying to find the answers to the questions I am asking, this is how it is done : XML File : repeater tubby nameDipsy/name colourGreen/colour /tubby tubby nameLaalaa/name colourRed/colour /tubby tubby namePo/name colourPurple/colour /tubby /repeater XSL File : xsl:for-each select=repeater/tubby fo:block Name : xsl:value-of select=name/ / Colour : xsl:value-of select=colour/ /fo:block /xsl:for-each This will generate the following pdf : Name : Dipsy / Colour : Green Name : Laalaa / Colour : Red Name : Po / Colour : Purple Once again thanks to all those who replied -Original Message- From: Manuel Reyes Sent: 20 November 2003 11:36 To: [EMAIL PROTECTED] Subject: RE: Merging XML and FO files That's great, thanks a lot for those files they more or less cover everything I needed to know. One small thing though, due to the nature of the documents I am creating the ability to create intelligent tables is essential. As an example I have a table called foos in which all my foos are listed, the data being held in a database. Now as the total of foos I have increases (or decreases), I will need to regenerate the table (PDF) and this table needs to look professional. So I need something that will allow me to create dynamic tables that will only contain the amount of rows I need to add the details of the foos in the database. I had a look around on http://www-106.ibm.com/developerworks/xml/ I found some information about basic merging, but nothing on dynamic merges. -Original Message- From: Manjush G. Menon [mailto:[EMAIL PROTECTED] Sent: 20 November 2003 06:45 To: [EMAIL PROTECTED] Subject: Fw: Merging XML and FO files Iam sorry the about the missed attachment. -- Manjush G Menon/\ASCII Ribbon Campaign [EMAIL PROTECTED] \ /Respect for open standards FSC Consultant X No HTML/RTF in email FSC SGB Governing body member / \No M$ Word docs in email - Original Message - From: Manjush G. Menon [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, November 20, 2003 9:18 AM Subject: Re: Merging XML and FO files Hi, Iam using FOP in a similar scenario. As Charles said, its XSLT that you need Please try out the XML/XSL:FO attached. -- Thanks Manjush - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, November 19, 2003 11:59 PM Subject: RE: Merging XML and FO files The instructions at this link (http://xml.apache.org/fop/running.html#standalone-start) seem pretty clear to me. I think the piece you are missing is an XSLT stylesheet to convert your XML to XSL-FO. -- Charles Knell [EMAIL PROTECTED] - email -Original Message- From: Manuel Reyes [EMAIL PROTECTED] Sent: Wed, 19 Nov 2003 17:51:51 - To: [EMAIL PROTECTED] Subject: Merging XML and FO files Hello all, I am currently working on an application that will pull data values from a database and place these into an XML file. The resulting XML file is then to be merged with an FO template file and the result would be used to generate a PDF The reason for the mail, is that I wanted to get opinions on the best way to go about doing this. In my minds eye I have the following idea : XML File (containing data values) : merge_test_report field_values value id=@value1abc - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED
RE: Merging XML and FO files
No it should work as written. Because when the xslt processor is the template that matches on tubby, its context is its tubby node. So you just need to select the value of the name child xsl: value-of select=name/ -Original Message- From: Manuel Reyes [mailto:[EMAIL PROTECTED] Sent: 20 November, 2003 13:35 To: [EMAIL PROTECTED] Subject: RE: Merging XML and FO files That's an interesting way of doing this, and will probably come in handy for the documents I need to produce. Thanks a lot. To get the code to work I needed to change this slightly: xsl:template match=repeater xsl:apply-templates select=tubby/ /xsl:template xsl:template match=tubby fo:block Name : xsl:value-of select=repeater/tubby/name/ / Colour : xsl:value-of select=repeater/tubby/colour/ /fo:block /xsl:template What I did find is that this only prints the first tubby value found inside data/repeater. Is there a way to get all the values (I did notice that I could use for-each inside the xsl:template to do this) Regards Manuel -Original Message- From: Chris Adams [mailto:[EMAIL PROTECTED] Sent: 20 November 2003 12:11 To: [EMAIL PROTECTED] Subject: RE: Merging XML and FO files You could have also done it like xsl:template match=repeater xsl:apply-templates select=tubby/ /xsl:template xsl:template match=tubby fo:block Name : xsl:value-of select=name/ / Colour : xsl:value-of select=colour/ /fo:block /xsl:template -Original Message- From: Manuel Reyes [mailto:[EMAIL PROTECTED] Sent: 20 November, 2003 12:08 To: [EMAIL PROTECTED] Subject: RE: Merging XML and FO files For anybody who may be searching this list in trying to find the answers to the questions I am asking, this is how it is done : XML File : repeater tubby nameDipsy/name colourGreen/colour /tubby tubby nameLaalaa/name colourRed/colour /tubby tubby namePo/name colourPurple/colour /tubby /repeater XSL File : xsl:for-each select=repeater/tubby fo:block Name : xsl:value-of select=name/ / Colour : xsl:value-of select=colour/ /fo:block /xsl:for-each This will generate the following pdf : Name : Dipsy / Colour : Green Name : Laalaa / Colour : Red Name : Po / Colour : Purple Once again thanks to all those who replied -Original Message- From: Manuel Reyes Sent: 20 November 2003 11:36 To: [EMAIL PROTECTED] Subject: RE: Merging XML and FO files That's great, thanks a lot for those files they more or less cover everything I needed to know. One small thing though, due to the nature of the documents I am creating the ability to create intelligent tables is essential. As an example I have a table called foos in which all my foos are listed, the data being held in a database. Now as the total of foos I have increases (or decreases), I will need to regenerate the table (PDF) and this table needs to look professional. So I need something that will allow me to create dynamic tables that will only contain the amount of rows I need to add the details of the foos in the database. I had a look around on http://www-106.ibm.com/developerworks/xml/ I found some information about basic merging, but nothing on dynamic merges. -Original Message- From: Manjush G. Menon [mailto:[EMAIL PROTECTED] Sent: 20 November 2003 06:45 To: [EMAIL PROTECTED] Subject: Fw: Merging XML and FO files Iam sorry the about the missed attachment. -- Manjush G Menon/\ASCII Ribbon Campaign [EMAIL PROTECTED] \ /Respect for open standards FSC Consultant X No HTML/RTF in email FSC SGB Governing body member / \No M$ Word docs in email - Original Message - From: Manjush G. Menon [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, November 20, 2003 9:18 AM Subject: Re: Merging XML and FO files Hi, Iam using FOP in a similar scenario. As Charles said, its XSLT that you need Please try out the XML/XSL:FO attached. -- Thanks Manjush - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, November 19, 2003 11:59 PM Subject: RE: Merging XML and FO files The instructions at this link (http://xml.apache.org/fop/running.html#standalone-start) seem pretty clear to me. I think the piece you are missing is an XSLT stylesheet to convert your XML to XSL-FO. -- Charles Knell [EMAIL PROTECTED] - email -Original Message- From: Manuel Reyes [EMAIL PROTECTED] Sent: Wed, 19 Nov 2003 17:51:51 - To: [EMAIL PROTECTED] Subject: Merging XML and FO files Hello all, I am currently working on an application that will pull data values from a database and place these into an XML file. The resulting XML file is then to be merged with an FO template file and the result would be used to generate a PDF The reason for the mail, is that I wanted to get opinions on the best way to go about
Re: Merging XML and FO files
[EMAIL PROTECTED] wrote: Hello all, I am currently working on an application that will pull data values from = a database and place these into an XML file. The resulting XML file is = then to be merged with an FO template file and the result would be used = to generate a PDF Sounds like Cocoon to me. Cocoon is a framework which happens to use Fop for its PDF rendering. The learning curve may be a bit steep though. Also possibly xReporter Finding URLs is left as an exercise for the reader. Alex - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Merging XML and FO files
The instructions at this link (http://xml.apache.org/fop/running.html#standalone-start) seem pretty clear to me. I think the piece you are missing is an XSLT stylesheet to convert your XML to XSL-FO. -- Charles Knell [EMAIL PROTECTED] - email -Original Message- From: Manuel Reyes [EMAIL PROTECTED] Sent: Wed, 19 Nov 2003 17:51:51 - To: [EMAIL PROTECTED] Subject: Merging XML and FO files Hello all, I am currently working on an application that will pull data values from a database and place these into an XML file. The resulting XML file is then to be merged with an FO template file and the result would be used to generate a PDF The reason for the mail, is that I wanted to get opinions on the best way to go about doing this. In my minds eye I have the following idea : XML File (containing data values) : merge_test_report field_values value id=@value1abc/value value id=@value2def/value /field_values repeat_values repeater id=1 values value id=@mvalue1rep 1a/value value id=@mvalue2rep 1b/value /values /repeater values value id=@mvalue1rep 2a/value value id=@mvalue2rep 2b/value /values /repeater repeat_values merge_test_report FO File (containing the base layout for the pdf) : fo:table table-layout=fixed fo:table-column column-width=10cm/ fo:table-body fo:table-row fo:table-cell fo:block text-align=left@value1 / @value2/fo:block /fo:table-cell /fo:table-row !-- STARTREPEATMERGE id=1 -- fo:table-row fo:table-cellfo:block@mvalue1 / @mvalue2/fo:block/fo:table-cell /fo:table-row !-- ENDREPEATMERGE id=1 -- /fo:table-body I would then create an application to read through the XML file and place its values into the FO template, which would create another FO file which would be processed by FOP. This would generate a PDF with something similar to this format : abc / def rep1a / rep 1b rep2a / rep 2b Considering I currently have about 4 hours experience of FOP and XSL-FO I am insure on whether this is the best way to proceed, or if FOP has any functionality that will make my life easier - bearing in mind the ability to create repeated tables is a must. I noticed from looking at the command line parameters for fop that there is an option for : Fop -xsl foo.xsl -xml foo.xml -pdf foo.pdf Which leads me to believe that fop may already have what I need; unfortunately I can seem to pin down the documentation/samples covering that functionality. Regards Manuel Reyes PS. The XML/XSL above may not be 100% correct, as it was just typed quickly into the message. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Merging XML and FO files
On Wed, 2003-11-19 at 14:59, [EMAIL PROTECTED] wrote: The instructions at this link (http://xml.apache.org/fop/running.html#standalone-start) seem pretty clear to me. I think the piece you are missing is an XSLT stylesheet to convert your XML to XSL-FO. There are some useful articles at ibm's Developerworks web site. Ten seconds on teoma or google ought to get you there. -- John Austin [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]