RE: Combining HTML/FO StyleSheets (Indirection/Abstrac
Peter wrote: > I have developing some XSLT files to translate an XML > document to HTML > and then moved onto creating XSL:FO translation of the same > document. I > noticed the bulk of the complex operations are the same or > very similar > for both style sheets and in order to avoid inconsistances I like to > merge the two sheets. > > Are there guidelines anywhere on developing such merged sheets? > > After slaving way at the problem I'll discuss below and > coming up with > several non-working solutions, I was wondering "Do people create > intermediate markup languages to ease the generation of both HTML and > FO?" By this I mean do people generate and intermediate format (XML) > which has all of the complex processing completed, and then have > trivial conversion style sheets from that format to HTML or XSL:FO as > appropriate? ((Example: intermediate tag like <paragraph> -> <p> or > <fo:block> depending on the desired output format)) Hi Peter, We've built a web site that will generate the data in XML and then present financial reports to the web client as either HTML, CSV(text) or PDF (converted from XSL-FO). In addressing the same issue, we have three different stylesheets, one for each desired output. As you can appreciate, some display logic is common, particularly between the HTML and XSL-FO version. Let's say I have report_html.xsl, report_fo.xsl and report_csv.xsl. One partial solution I developed was to write a stylesheet that transformed the report_html.xsl into report_fo.xsl. However, this was only a partial solution because I still needed to tweak the individual files as HTML doesn't require <fo:table-column> elements. With hindsight, one thing I would have changed is writing the report_fo.xsl first as this is more detailed, and then writing the stylesheet to transform it to report_html.xsl. In one sense, this is using XSL-FO as the intermediary format you mentioned. With the XSL-FO you can either generate the PDF, or generate the HTML. I'm sure other people will know of stylesheets that are already written to transform XSL-FO to HTML. Hope that helps and good luck, Joshua ------------------------------------------------------------------------------ This message and any attachment is confidential and may be privileged or otherwise protected from disclosure. If you have received it by mistake please let us know by reply and then delete it from your system; you should not copy the message or disclose its contents to anyone. XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
PURCHASE STYLUS STUDIO ONLINE TODAY!
Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!
Download The World's Best XML IDE!
Accelerate XML development with our award-winning XML IDE - Download a free trial today!
Subscribe in XML format