Re: Query
Hi Amit; I am also a newbie. I can tell you that a good place to start is the examples section that comes with the FOP download. Specifically the example ExampleXML2FO.java (fop-0.20.5\examples\embedding\java\embedding). Hope that helps, Luke - Original Message - From: Amit Chawla To: [EMAIL PROTECTED] Sent: Wednesday, January 19, 2005 2:01 PM Subject: Query Hi All, I am a newbie to FOP and XML... I need to ask you guys that how to generate XSL for the XML created at run time. and then to create XSL-FO at run time and then to pass it FOP and generate PDF.. If anybody could help me that will be gr8.. thanks in advance rgds amit
Re: Query
Amit, I agree with Luke. That is a good way to get started. Another great place to look is the FOP Resources page[1] . Hopefully you'll look at the resources FAQ[2] pages before you ask questions--cuts down on the chatter and lets the busy developers get FOP 1.0 out the door! ;-) You might find the answer you're looking for, and feel better about yourself at the same time! Web Maestro Clay [1] http://xml.apache.org/fop/resources.html [2] http://xml.apache.org/fop/faq.html p.s. Thanks for chiming in, Luke! I appreciate it very much and it's a good way to get involved. It's how I started to 'contribute' to FOP! On Jan 19, 2005, at 11:08 AM, Luke Shannon wrote: Hi Amit; I am also a newbie. I can tell you that a good place to start is the examples section that comes with the FOP download. Specifically the example ExampleXML2FO.java (fop-0.20.5\examples\embedding\java\embedding). Hope that helps, Luke - Original Message - From: Amit Chawla To: [EMAIL PROTECTED] Sent: Wednesday, January 19, 2005 2:01 PM Subject: Query Hi All, I am a newbie to FOP and XML... I need to ask you guys that how to generate XSL for the XML created at run time. and then to create XSL-FO at run time and then to pass it FOP and generate PDF.. If anybody could help me that will be gr8.. thanks in advance rgds amit Web Maestro Clay -- [EMAIL PROTECTED] - http://homepage.mac.com/webmaestro/ My religion is simple. My religion is kindness. - HH The 14th Dalai Lama of Tibet - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Query
Hi Luke, Thanks for the email reply.. actually i have seen that and what i have understood from it i require XSL file which will transform the xml to XSL-FO... and what is happening in my requirement is that i have to generate HTML at run time and then convert this HTML doc using TIdy to XML/XHTML and then use this to generate PDF I was facing problem with ITEXT as they dont support all the HTML tags and for generating PDF i had to write HTMLparser which i have done and am successful to generate PDF .. ... but the problem is that i am using FCKeditor as my internet editor where i can do formatting of text just like word doc... and it returns me string of html elements .. I have used this string to generate HTML doc and then xml. FCKeditor generates tags and there attributes which are not supported in ITEXT and i have to handle them in my HTML parser. I will lose format of text in my PDF as i am not aware what all tags and attributes FCKeditor will generate at run time.. So i decided to shift to FOP . hoping that it would suffice my needs ... so my situation is i have to parse this xml document which is generated at run time and i feel/think i will require to generate XSL at run time and then using the example i can generate XSL-FO and then set up driver of fop to generate PDF using FOP... Here i m stuck as i am not getting a way to generate XSL at run time... all help appreciated thanks for reply again. regards amit From: Luke Shannon [mailto:[EMAIL PROTECTED] Sent: Thu 1/20/2005 12:38 AM To: [EMAIL PROTECTED] Subject: Re: Query Hi Amit; I am also a newbie. I can tell you that a good place to start is the examples section that comes with the FOP download. Specifically the example ExampleXML2FO.java (fop-0.20.5\examples\embedding\java\embedding). Hope that helps, Luke - Original Message - From: Amit Chawla mailto:[EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, January 19, 2005 2:01 PM Subject: Query Hi All, I am a newbie to FOP and XML... I need to ask you guys that how to generate XSL for the XML created at run time. and then to create XSL-FO at run time and then to pass it FOP and generate PDF.. If anybody could help me that will be gr8.. thanks in advance rgds amit winmail.dat- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Query
I see. I am doing something similar. However, the XSL exists for me. I run this, getting an FO document in string form back. This string contains some HTML within the FO document, which needs to be further convert to FO objects (it is this department I am having my own trouble with). I tried to convert the HTML to FO in the XSL but was unsuccessful. I currently replace certain HTML tags with FO tags and strip the rest in java before I render with FOP. I would like to get Tidy involved at this point but I am getting some errors I have been unable to resolve. I suppose you could do something similar to me in which you looks for specific html tags and replace them with FO tags that perform the same function. Something like digester would allow you to parse the XML getting the contents of the nodes your are interested in. You could then sub out the tags and produce an FO document in memory that could be passed to FOP to generate your document. Honestly though, I'm not the best person to advise you since I have yet to get my own solution working and am not yet very strong in XSL. Luke - Original Message - From: Amit Chawla [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, January 19, 2005 2:19 PM Subject: RE: Query Hi Luke, Thanks for the email reply.. actually i have seen that and what i have understood from it i require XSL file which will transform the xml to XSL-FO... and what is happening in my requirement is that i have to generate HTML at run time and then convert this HTML doc using TIdy to XML/XHTML and then use this to generate PDF I was facing problem with ITEXT as they dont support all the HTML tags and for generating PDF i had to write HTMLparser which i have done and am successful to generate PDF .. ... but the problem is that i am using FCKeditor as my internet editor where i can do formatting of text just like word doc... and it returns me string of html elements .. I have used this string to generate HTML doc and then xml. FCKeditor generates tags and there attributes which are not supported in ITEXT and i have to handle them in my HTML parser. I will lose format of text in my PDF as i am not aware what all tags and attributes FCKeditor will generate at run time.. So i decided to shift to FOP . hoping that it would suffice my needs ... so my situation is i have to parse this xml document which is generated at run time and i feel/think i will require to generate XSL at run time and then using the example i can generate XSL-FO and then set up driver of fop to generate PDF using FOP... Here i m stuck as i am not getting a way to generate XSL at run time... all help appreciated thanks for reply again. regards amit _ From: Luke Shannon [mailto:[EMAIL PROTECTED] Sent: Thu 1/20/2005 12:38 AM To: [EMAIL PROTECTED] Subject: Re: Query Hi Amit; I am also a newbie. I can tell you that a good place to start is the examples section that comes with the FOP download. Specifically the example ExampleXML2FO.java (fop-0.20.5\examples\embedding\java\embedding). Hope that helps, Luke - Original Message - From: Amit Chawla mailto:[EMAIL PROTECTED] To: [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] Sent: Wednesday, January 19, 2005 2:01 PM Subject: Query Hi All, I am a newbie to FOP and XML... I need to ask you guys that how to generate XSL for the XML created at run time. and then to create XSL-FO at run time and then to pass it FOP and generate PDF.. If anybody could help me that will be gr8.. thanks in advance rgds amit - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Query
I bet the dynamic XSL generation would be really a difficult thing if not impossible. Instead I would suggest to know all the HTML tags that FCKeditor generates. I am pretty sure it will be an almost equalent set of normal HTML tags. And once you know the those tags, write XSL templates to convert XML (call it XHTML or HTML in well formed XML format) generated by FCKeditor into FOs, and finally call FOP api to generate PDF. All the best Sai |-+- | | Amit Chawla | | | [EMAIL PROTECTED]| | | lasoft.com | | | | | | 01/19/2005 02:19 PM | | | Please respond to | | | fop-user | | | | |-+- --| | | |To: [EMAIL PROTECTED] | |cc: | |Subject: RE: Query | --| Hi Luke, Thanks for the email reply.. actually i have seen that and what i have understood from it i require XSL file which will transform the xml to XSL-FO... and what is happening in my requirement is that i have to generate HTML at run time and then convert this HTML doc using TIdy to XML/XHTML and then use this to generate PDF I was facing problem with ITEXT as they dont support all the HTML tags and for generating PDF i had to write HTMLparser which i have done and am successful to generate PDF .. ... but the problem is that i am using FCKeditor as my internet editor where i can do formatting of text just like word doc... and it returns me string of html elements .. I have used this string to generate HTML doc and then xml. FCKeditor generates tags and there attributes which are not supported in ITEXT and i have to handle them in my HTML parser. I will lose format of text in my PDF as i am not aware what all tags and attributes FCKeditor will generate at run time.. So i decided to shift to FOP . hoping that it would suffice my needs ... so my situation is i have to parse this xml document which is generated at run time and i feel/think i will require to generate XSL at run time and then using the example i can generate XSL-FO and then set up driver of fop to generate PDF using FOP... Here i m stuck as i am not getting a way to generate XSL at run time... all help appreciated thanks for reply again. regards amit From: Luke Shannon [mailto:[EMAIL PROTECTED] Sent: Thu 1/20/2005 12:38 AM To: [EMAIL PROTECTED] Subject: Re: Query Hi Amit; I am also a newbie. I can tell you that a good place to start is the examples section that comes with the FOP download. Specifically the example ExampleXML2FO.java (fop-0.20.5\examples\embedding\java\embedding). Hope that helps, Luke - Original Message - From: Amit Chawla mailto:[EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, January 19, 2005 2:01 PM Subject: Query Hi All, I am a newbie to FOP and XML... I need to ask you guys that how to generate XSL for the XML created at run time. and then to create XSL-FO at run time and then to pass it FOP and generate PDF.. If anybody could help me that will be gr8.. thanks in advance rgds amit (See attached file: winmail.dat) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] attachment: winmail.dat- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Query
Dear Luke, hey buddy first of all let me convey that no one is best or bad .. everyone is gr8 and are good... so any help for anyone is helpful.. Tidy i feel is tool to clean up HTML and convert it into XML/XHTML and i feel it will not do that for FO ..or will does it... Secondly ur scenerio that u have re convert HTML elements in FO to FO... Why does FO has Html elements left over as ur XSL should convert it to all FO... why dont u modify the XSL u have to have full FO. Other wise in ur case u have to have new XSL which will handle ur FO objects also... and convert all into FO. Yes i saw Digester too and then i realised its good component if i have knowledge of format in advance as it will gives me events or what if it encountered some tag or something.. and accordingly generate PDF. But in my case i dont have advance knowledge and anythig can come at run time as FCK editor is javascript based editor and generates HTML strings.. if i had this information my 90% work is already done using ITEXT... i am successful in generating PDF and i believe if you have to do something on some event or what ITEXT is best as it gives you APIs to do sometghing as example if u encountered TD u can addcell in PDFTable or what. Thanks regards Amit From: Luke Shannon [mailto:[EMAIL PROTECTED] Sent: Thu 1/20/2005 1:06 AM To: [EMAIL PROTECTED] Subject: Re: Query I see. I am doing something similar. However, the XSL exists for me. I run this, getting an FO document in string form back. This string contains some HTML within the FO document, which needs to be further convert to FO objects (it is this department I am having my own trouble with). I tried to convert the HTML to FO in the XSL but was unsuccessful. I currently replace certain HTML tags with FO tags and strip the rest in java before I render with FOP. I would like to get Tidy involved at this point but I am getting some errors I have been unable to resolve. I suppose you could do something similar to me in which you looks for specific html tags and replace them with FO tags that perform the same function. Something like digester would allow you to parse the XML getting the contents of the nodes your are interested in. You could then sub out the tags and produce an FO document in memory that could be passed to FOP to generate your document. Honestly though, I'm not the best person to advise you since I have yet to get my own solution working and am not yet very strong in XSL. Luke - Original Message - From: Amit Chawla [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, January 19, 2005 2:19 PM Subject: RE: Query Hi Luke, Thanks for the email reply.. actually i have seen that and what i have understood from it i require XSL file which will transform the xml to XSL-FO... and what is happening in my requirement is that i have to generate HTML at run time and then convert this HTML doc using TIdy to XML/XHTML and then use this to generate PDF I was facing problem with ITEXT as they dont support all the HTML tags and for generating PDF i had to write HTMLparser which i have done and am successful to generate PDF .. ... but the problem is that i am using FCKeditor as my internet editor where i can do formatting of text just like word doc... and it returns me string of html elements .. I have used this string to generate HTML doc and then xml. FCKeditor generates tags and there attributes which are not supported in ITEXT and i have to handle them in my HTML parser. I will lose format of text in my PDF as i am not aware what all tags and attributes FCKeditor will generate at run time.. So i decided to shift to FOP . hoping that it would suffice my needs ... so my situation is i have to parse this xml document which is generated at run time and i feel/think i will require to generate XSL at run time and then using the example i can generate XSL-FO and then set up driver of fop to generate PDF using FOP... Here i m stuck as i am not getting a way to generate XSL at run time... all help appreciated thanks for reply again. regards amit _ From: Luke Shannon [mailto:[EMAIL PROTECTED] Sent: Thu 1/20/2005 12:38 AM To: [EMAIL PROTECTED] Subject: Re: Query Hi Amit; I am also a newbie. I can tell you that a good place to start is the examples section that comes with the FOP download. Specifically the example ExampleXML2FO.java (fop-0.20.5\examples\embedding\java\embedding). Hope that helps, Luke - Original Message - From: Amit Chawla mailto:[EMAIL PROTECTED] To: [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] Sent: Wednesday, January 19, 2005 2:01 PM Subject: Query Hi All, I am a newbie to FOP and XML... I need to ask you guys that how to generate XSL for the XML created at run time. and then to create XSL-FO at run time and then to pass it FOP and generate PDF.. If anybody could help me