On Wednesday 01 August 2007 23:47, Steve Osmond wrote: > "Remember, you need to code the XSL that transforms html/xml to fo." > > Am I missing something obvious here? I have just written an xsl > <snippet in my first post> for fo which should be able to translate > right into the pdf, as far as I know. > > In previous cases I have not run into this problem of having html > contained in my xml. > > Thanks! >
Steve, if I understand correctly what you want to achieve I think you have what I would call a 'hard' problem here. Firstly you have HTML embedded as text in your XML. This is why all the HTML tags are escaped with the < and > entities. This means your stylesheet will not process these as normal tags but sees them simply as text. If you want to have the embedded HTML translated into fo formatting instructions, like translate <p> to <fo:block>, you need to get the HTML unescaped into your XML document and then modify your stylesheet to handle the translation of the HTML tags into fo elements. Be aware that for this to work the HTML must(!) be proper XML, that is all tags properly nested and closed. If you can't guarantee that your input as provided by the users through the HTML editor satisfies this you cannot process that data through XSL as any XSL processor requires its input to be proper XML. You may be able to work around this by preprocessing the comments containing HTML through something like HTML Tidy to get to proper XHTML. I can't tell you how to get the comment text unescaped into your XML as that depends on how the XML is constructed in your environment. Assuming this is all sorted out you now need to modify your stylesheet to handle the translation of the comments containing XHTML to FO. For this see the FOP FAQ and the FOP Resources pages on the web site and search this list. Be aware that translating XHMTL to FO requires fairly complex stylesheets. Hope this gives you some ideas what to do (or not to do) Manuel > _____ > > To: [email protected] > Subject: Re: xml with html in it -> pdf issue > From: [EMAIL PROTECTED] > Date: Wed, 1 Aug 2007 07:40:47 -0400 > > > Stephen: > > Can you provide a snippet of your xml source? Remember, you need to > code the XSL that transforms html/xml to fo. > > -Lou > > Steve Osmond <[EMAIL PROTECTED]> wrote on 07/31/2007 08:15:55 PM: > > Hello, > > > > I am having an issue transforming some XML to a PDF. The xml > > contains html which should show up in the PDF as what the html > > would look like in a browser. > > > > At present, the html shows up when the pdf is generated with > > tags, such as <p>hello</p> > > > > Here is the snip from my xsl: > > > > <fo:table-row number-rows-spanned="3" > > > <fo:table-cell number-columns-spanned="4"> > > <fo:block > > > <xsl:value-of select="COMMENTS"/> > > </fo:block> > > </fo:table-cell> > > </fo:table-row> > > > > > > Let me know if I can give any more helpful information. > > > > Thanks, > > > > Stephen > > > > Connect to the next generation of MSN Messenger Get it now! > > > > > > Get news, entertainment and everything you care about at Live.com. > > Check it out! > > _____ > > Explore the seven wonders of the world Learn more! > <http://search.msn.com/results.aspx?q=7+wonders+world&mkt=en-US&form= >QBR E> --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
