On Wed, 2 Nov 2005 01:32 pm, Leon Pu wrote: > --- Daniel Noll <[EMAIL PROTECTED]> wrote: > > Leon Pu wrote: > > >So, is it possible to use one stylesheet to transform XML to both > > > > HTML > > > > >and PDF? > > > > Not as such. Though it might be possible to cheat by writing one > > stylesheet to transform to HTML, and then transforming the HTML to > > XSL-FO in a separate step using a stylesheet which will be > > constant. > > It means we have to do the generation of HTML and PDF in two steps? > What's the method in some websites that provide the PDF download for > current webpage? Are these websites using the same solution? > Typically two different approaches will be used:
a) The site is written in XML and two different stylesheets are used. One for conversion to HTML and one for conversion into XSL-FO. The XSL-FO output is then given to an XSL-FO processor (e.g. FOP) for conversion into PDF. Note that most XSL-FO processors can make the two steps XML -> XSL-FO and XSL-FO -> PDF look like one but internally both conversions are performed. b) The site is written in XHMTL and a stylesheet is used to convert XHMTL into XSL-FO. Again this is followed by the XSL-FO -> PDF conversion. A possible third alternative is for a site written in HTML that an HTML to XHTML conversion tool is used (Note this would not be XSL based). So we have HTML -> XHTML using a 3rd party tool, XHTML -> XSL-FO using an XSL stylesheet and processor (e.g. XALAN), XSL-FO -> PDF (e.g. FOP). > Thanks for your reply. > > Leon > Manuel --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
