RE: Help with layout and design
Hi, As far as I can tell, your current data is in some kind of fixed width columns, padded with spaces. If this is the case, you could just use substring(string,start[,len]) to cut it up. Obviously this would require knowing the width of the column. As a variation on Andreas' solution, maybe the splitting criteria could be the presence of n spaces (3 or so?) Obviously these can break if the data ever gets too long and breaks the fixed-length column layout, or contains multiple spaces in the data, or the data is just small enough and there is only one space between columns. Cheers, Jonathan Winterflood (3237) Capgemini Ouest - Agence de Brest P Please consider the environment and do not print this email unless absolutely necessary. Capgemini encourages environmental awareness De : Ashish Kulkarni [mailto:[EMAIL PROTECTED] Envoyé : jeudi 31 juillet 2008 21:14 À : fop-users@xmlgraphics.apache.org Objet : Re: Help with layout and design Hi The issue, i am not the one designing this XML file, but it is already exisiting XML file, used in some other application, This application some how has a templelate and then takes this XML file and mergers with this template to create PDF file, and i have to analyize if we can do this uing XSL-FO with out modifying the XML file. I guess we cannot use the XML file as is, but have to modify the XML file to add some sort of delimiter to the data Ashish On Thu, Jul 31, 2008 at 12:51 PM, Griffin,Sean [EMAIL PROTECTED] wrote: I don't think your problem will be XSLT and certainly not XSL-FO but how you tell the difference between one column and the next and which data element you're actually dealing with. Just pseudo-code, outside of any particular language, what would the algorithm be for determining that. How you turn that algorithm into code in XSLT could be trivial, if it's even safely possible. From: Ashish Kulkarni [mailto:[EMAIL PROTECTED] Sent: Thursday, July 31, 2008 11:15 AM To: fop-users@xmlgraphics.apache.org Subject: Help with layout and design Hi I have an XML file where the data is as below data line1My Name1 of 1/line1 line2My Address 01/12/2008/line2 !--more lines of data here -- /data I need to have boxes on PDF file like below, where i will hard code Name, page ___ Name: My Name Page: 1of 1 Address: My Address Date: 01/12/2008 ___ Is it possible to do some thing like this using XSLT and XSL-Fo Any suggestions CONFIDENTIALITY NOTICE This message and any included attachments are from Cerner Corporation and are intended only for the addressee. The information contained in this message is confidential and may constitute inside or non-public information under international, federal, or state securities laws. Unauthorized forwarding, printing, copying, distribution, or use of such information is strictly prohibited and may be unlawful. If you are not the addressee, please promptly delete this message and notify the sender of the delivery error by e-mail or you may call Cerner's corporate offices in Kansas City, Missouri, U.S.A at (+1) (816)221-1024. This message contains information that may be privileged or confidential and is the property of the Capgemini Group. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message.
RE: Help with layout and design
I don't think your problem will be XSLT and certainly not XSL-FO but how you tell the difference between one column and the next and which data element you're actually dealing with. Just pseudo-code, outside of any particular language, what would the algorithm be for determining that. How you turn that algorithm into code in XSLT could be trivial, if it's even safely possible. From: Ashish Kulkarni [mailto:[EMAIL PROTECTED] Sent: Thursday, July 31, 2008 11:15 AM To: fop-users@xmlgraphics.apache.org Subject: Help with layout and design Hi I have an XML file where the data is as below data line1My Name1 of 1/line1 line2My Address 01/12/2008/line2 !--more lines of data here -- /data I need to have boxes on PDF file like below, where i will hard code Name, page ___ Name: My Name Page: 1of 1 Address: My Address Date: 01/12/2008 ___ Is it possible to do some thing like this using XSLT and XSL-Fo Any suggestions -- CONFIDENTIALITY NOTICE This message and any included attachments are from Cerner Corporation and are intended only for the addressee. The information contained in this message is confidential and may constitute inside or non-public information under international, federal, or state securities laws. Unauthorized forwarding, printing, copying, distribution, or use of such information is strictly prohibited and may be unlawful. If you are not the addressee, please promptly delete this message and notify the sender of the delivery error by e-mail or you may call Cerner's corporate offices in Kansas City, Missouri, U.S.A at (+1) (816)221-1024.
Re: Help with layout and design
On Jul 31, 2008, at 18:14, Ashish Kulkarni wrote: Hi Strictly speaking this is a purely XSLT-related question, so it does not really belong here. Please keep that in mind for the future. This is a list for questions about using FOP. Thanks! Now to answer your question: I have an XML file where the data is as below data line1My Name1 of 1/line1 line2My Address 01/12/2008/ line2 !--more lines of data here -- /data I need to have boxes on PDF file like below, where i will hard code Name, page ___ Name: My Name Page: 1of 1 Address: My Address Date: 01/12/2008 ___ Is it possible to do some thing like this using XSLT and XSL-Fo Sure, but the input XML is far from an ideal format. You have to go looking for a criterion that can be used to split the text-nodes, and /that/ part may turn out to get messy, if I interpret correctly... How would you determine where the name in line1 ends? Or the address in line2? Other than that, it's not very difficult. If you would have: data line1My Name#1 of 1/line1 line2My Address#01/12/2008/line2 /data then you could XPath's substring-before() and substring-after() to get to the right parts. It would then be a very straightforward matching template for the data-elements. xsl:template match=data block-container border=solid 1pt black table table-layout=fixed inline-progression-dimension=100% table-column column-width=proportional-column-width(1) number-columns-repeated=2 / table-body table-cell starts-row=true text-align=start block wrapper font-weight=boldName:/wrapper xsl:text /xsl:text xsl:value-of select=substring-before(line1, '#') / /block /table-cell table-cell ends-row=true text-align=end block wrapper font-weight=boldPage:/wrapper xsl:text /xsl:text xsl:value-of select=substring-after(line1, '#') / /block /table-cell table-cell starts-row=true text-align=start block wrapper font-weight=boldAddress:/wrapper xsl:text /xsl:text xsl:value-of select=substring-before(line2, '#') / /block /table-cell table-cell ends-row=true text-align=end block wrapper font-weight=boldDate:/wrapper xsl:text /xsl:text xsl:value-of select=substring-after(line2, '#') / /block /table-cell /table-body /table /block-container /xsl:template HTH! Andreas - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Help with layout and design
Hi The issue, i am not the one designing this XML file, but it is already exisiting XML file, used in some other application, This application some how has a templelate and then takes this XML file and mergers with this template to create PDF file, and i have to analyize if we can do this uing XSL-FO with out modifying the XML file. I guess we cannot use the XML file as is, but have to modify the XML file to add some sort of delimiter to the data Ashish On Thu, Jul 31, 2008 at 12:51 PM, Griffin,Sean [EMAIL PROTECTED] wrote: I don't think your problem will be XSLT and certainly not XSL-FO but how you tell the difference between one column and the next and which data element you're actually dealing with. Just pseudo-code, outside of any particular language, what would the algorithm be for determining that. How you turn that algorithm into code in XSLT could be trivial, if it's even safely possible. *From:* Ashish Kulkarni [mailto:[EMAIL PROTECTED] *Sent:* Thursday, July 31, 2008 11:15 AM *To:* fop-users@xmlgraphics.apache.org *Subject:* Help with layout and design Hi I have an XML file where the data is as below data line1My Name1 of 1/line1 line2My Address 01/12/2008/line2 !--more lines of data here -- /data I need to have boxes on PDF file like below, where i will hard code Name, page ___ Name: My Name Page: 1of 1 Address: My Address Date: 01/12/2008 ___ Is it possible to do some thing like this using XSLT and XSL-Fo Any suggestions -- CONFIDENTIALITY NOTICE This message and any included attachments are from Cerner Corporation and are intended only for the addressee. The information contained in this message is confidential and may constitute inside or non-public information under international, federal, or state securities laws. Unauthorized forwarding, printing, copying, distribution, or use of such information is strictly prohibited and may be unlawful. If you are not the addressee, please promptly delete this message and notify the sender of the delivery error by e-mail or you may call Cerner's corporate offices in Kansas City, Missouri, U.S.A at (+1) (816)221-1024.