Loading ...
Sorry, an error occurred while loading the content.

Re: embedded HTML in XML - PDF conversion

Expand Messages
  • araffoul
    Thank you for this info. I have created the following sample file and than called it from a web browser expecting to generate a newly formatted document
    Message 1 of 10 , Jun 2, 2003
    • 0 Attachment
      Thank you for this info.

      I have created the following sample file and than called it from a
      web browser expecting to generate a newly formatted document
      containing the FO tags. However my browser simply rendered the
      original HTML document. How do I generate/receive the formatted XSL-
      FO?

      Thank you again for all the help you provided me.


      <?xml version="1.0" encoding="ISO-8859-1"?>
      <?xml-stylesheet type="text/xsl" href="Xhtml2fo.xsl"?>
      <html>
      <body>
      The content of the body element is displayed in your browser.
      <table>
      <tr>
      <td>test1</td>
      <td>test2</td>
      </tr>
      </table>

      </body>
      </html>


      --- In XSL-FO@yahoogroups.com, Dahlquist_Michael/shure@s... wrote:
      > I meant to say: the HTML in your XML is well-formed, so it can be
      > transformed by a stylesheet. It does seem that XHTML2FO would work
      for
      > you, with your own additions to deal with any non-HTML XML you may
      want
      > transformed.
      >
      > The process is: install an FO processor, such as FOP, renderx,
      antenna
      > house, etc. Use xhtml2fo.xsl (or your own version) to transform the
      XML
      > documents output from your database into FO (which is XML with both
      > data and formatting information). Then use your FO processor to
      convert
      > the FO to PDF. (Most processors deal with both the transform-to-FO
      and
      > the convert-to-PDF processes.)
      >
      > Apache has Cocoon (http://xml.apache.org/cocoon), which you can use
      to
      > generate PDF files from XML on the fly, over the web.
      >
      > I hope this helps -
      >
      > Michael
      >
      >
      > -----Original Message-----
      > From: araffoul [mailto:araffoul@y...]
      > Sent: Monday, June 02, 2003 3:18 PM
      > To: XSL-FO
      > Cc: araffoul
      > Subject: [XSL-FO] Re: embedded HTML in XML - PDF conversion
      >
      >
      > It is easy to output XML nodes containg HTML using XSL because the
      > end result is HTML. I'm doing this as follows:
      >
      > <xsl:value-of select="Notes_E" disable-output-escaping="yes"/>
      >
      > disable-output-escaping="yes" will preserve all HTML. However since
      I
      > want to produce PDF, I have to basically translate the HTML to XSL-
      FO
      > and than process it to produce the PDF. Coding a translator between
      > HTML to XSL-FO is almost impossible. I'm wondering if there is
      > something already available that I can use. XHTML2FO looks like a
      > good solution. I'm just having a hard time using it.
      >
      > The PDF file has to be also generated on the fly from the web site.
      >
      > I appreciate receiving other suggestions to solving this problem.
      >
      > Thank you,
      >
      > --- In XSL-FO@yahoogroups.com, Dahlquist_Michael/shure@s... wrote:
      > > Why does having HTML tags within your XML prevent you from using
      > XSL-FO
      > > stylesheets? If you're using XSL to output HTML, I'd think you
      > could
      > > use XSL-FO to output FO->PDF. Though I may be missing something,
      > too.
      > >
      > > Michael
      > >
      > >
      > > -----Original Message-----
      > > From: araffoul [mailto:araffoul@y...]
      > > Sent: Monday, June 02, 2003 2:57 PM
      > > To: XSL-FO
      > > Cc: araffoul
      > > Subject: [XSL-FO] Re: embedded HTML in XML - PDF conversion
      > >
      > >
      > > Sorry, I may have misled you.
      > >
      > > I'm generating XML file from a SQL database than using XSL
      > producing
      > > HTML. I would also like to produce PDF files. The problem I'm
      > having
      > > is some nodes within the XML document contain formatted data
      using
      > > HTML tags. Therefore it is not possible for me to create XSL-FO
      > > stylesheets for producing PDF because of the HTML content of some
      > > nodes.
      > >
      > > Therefore I though that I can potentially break the problem in
      two:
      > > 1- Generate XSL-FO to process the "normal" XML nodes (nodes not
      > > containing HTML)
      > > 2- For nodes that contain HTML process them through another
      > interface
      > > that can potentially generate the XSL-FO.
      > >
      > > In theory I should be able to process the resulting HTML file
      from
      > > the original XML and XSL to produce the XSL-FO. However, I think
      > that
      > > it will be more efficient to produce the XSL-FO manually because
      I
      > > have more control over the display.
      > >
      > > Does this sound ok? Is there something missing.
      > >
      > > Thank you again.
      > > --- In XSL-FO@yahoogroups.com, "G. Ken Holman" <gkholman@c...>
      > wrote:
      > > > At 2003-06-02 19:26 +0000, araffoul wrote:
      > > > >Actually I'm looking at this solution, however I don't know
      how
      > to
      > > > >use it.
      > > >
      > > > If you are unaware of XSL-FO and stylesheets, why is it you
      think
      > > you need
      > > > XSL-FO? Are you sure you are looking for the information that
      > you
      > > > need? Perhaps you are confusing XSL-FO with something else
      that
      > > you need.
      > > >
      > > > >Assume I have an HTML File called test.html. How do I send it
      > > through
      > > > >xhtml2fo for formatting.
      > > >
      > > > xhtml2fo is an XSLT stylesheet for use with XML inputs, so you
      > > would use it
      > > > as you would use any other XSLT stylesheet:
      > > >
      > > > (1) - convert your HTML to XHTML
      > > > - perhaps using http://tidy.sf.net for conversion
      > > >
      > > > (2) - use XSLT to convert XHTML to XSL-FO
      > > >
      > > > (3) - use an XSL-FO engine to create the formatted output
      > > > - the engine might even incorporate (2) as Antenna House
      does
      > > >
      > > > And please learn more about what XSL-FO is and where it is used
      > > from web
      > > > sites or even from the free preview of our book that is
      available
      > > off our
      > > > web site.
      > > >
      > > > I hope this helps.
      > > >
      > > > ................... Ken
      > > >
      > > >
      > > > --
      > > > Upcoming hands-on courses: (registration still open!)
      > > > - (XSLT/XPath and/or XSL-FO) North America: June 16-20,
      2003
      > > >
      > > > G. Ken Holman mailto:gkholman@C...
      > > > Crane Softwrights Ltd.
      http://www.CraneSoftwrights.com/f/
      > > > Box 266, Kars, Ontario CANADA K0A-2E0 +1(613)489-0999 (F:-
      0995)
      > > > ISBN 0-13-065196-6 Definitive XSLT and
      XPath
      > > > ISBN 0-13-140374-5 Definitive XSL-
      FO
      > > > ISBN 1-894049-08-X Practical Transformation Using XSLT and
      XPath
      > > > ISBN 1-894049-11-X Practical Formatting Using XSL-
      FO
      > > > Member of the XML Guild of Practitioners:
      http://XMLGuild.info
      > > > Male Breast Cancer Awareness
      http://www.CraneSoftwrights.com/f/bc
      > >
      > >
      > >
      > > To unsubscribe from this group, send an email to:
      > > XSL-FO-unsubscribe@egroups.com
      > >
      > >
      > >
      > > Your use of Yahoo! Groups is subject to
      > > http://docs.yahoo.com/info/terms/
      >
      >
      >
      > To unsubscribe from this group, send an email to:
      > XSL-FO-unsubscribe@egroups.com
      >
      >
      >
      > Your use of Yahoo! Groups is subject to
      > http://docs.yahoo.com/info/terms/
    • Dahlquist_Michael/shure@shure.com
      You don t want to format the XHTML with a stylesheet for display in a browser; you want to transform it into FO. You ll have to use an XSLT processor, like
      Message 2 of 10 , Jun 3, 2003
      • 0 Attachment
        You don't want to format the XHTML with a stylesheet for display in a
        browser; you want to transform it into FO. You'll have to use an XSLT
        processor, like Saxon (http://saxon.sourceforge.net/), not IE, to get
        FO.

        I added html as a namespace in your xml file:

        <?xml version="1.0" encoding="utf-8"?>
        <html:html xmlns:html="http://www.w3.org/1999/xhtml">
        <html:body>
        The content of the body element is displayed in your browser.
        <html:table>
        <html:tr>
        <html:td>test1</html:td>
        <html:td>test2</html:td>
        </html:tr>
        </html:table>

        </html:body>
        </html:html>

        ...and it processed fine in Saxon, as well as in FOP processors (which
        will give you a PDF directly from your XML) like XEP:

        http://xep.xattic.com/

        It also processed fine in Antenna House - and if you still have
        questions about how this all works, I recommend their tutorial:

        http://www.antennahouse.com/XSLsample/XSLsample.htm

        Michael


        -----Original Message-----
        From: araffoul [mailto:araffoul@...]
        Sent: Monday, June 02, 2003 4:28 PM
        To: XSL-FO
        Cc: araffoul
        Subject: [XSL-FO] Re: embedded HTML in XML - PDF conversion


        Thank you for this info.

        I have created the following sample file and than called it from a
        web browser expecting to generate a newly formatted document
        containing the FO tags. However my browser simply rendered the
        original HTML document. How do I generate/receive the formatted XSL-
        FO?

        Thank you again for all the help you provided me.


        <?xml version="1.0" encoding="ISO-8859-1"?>
        <?xml-stylesheet type="text/xsl" href="Xhtml2fo.xsl"?>
        <html>
        <body>
        The content of the body element is displayed in your browser.
        <table>
        <tr>
        <td>test1</td>
        <td>test2</td>
        </tr>
        </table>

        </body>
        </html>


        --- In XSL-FO@yahoogroups.com, Dahlquist_Michael/shure@s... wrote:
        > I meant to say: the HTML in your XML is well-formed, so it can be
        > transformed by a stylesheet. It does seem that XHTML2FO would work
        for
        > you, with your own additions to deal with any non-HTML XML you may
        want
        > transformed.
        >
        > The process is: install an FO processor, such as FOP, renderx,
        antenna
        > house, etc. Use xhtml2fo.xsl (or your own version) to transform the
        XML
        > documents output from your database into FO (which is XML with both
        > data and formatting information). Then use your FO processor to
        convert
        > the FO to PDF. (Most processors deal with both the transform-to-FO
        and
        > the convert-to-PDF processes.)
        >
        > Apache has Cocoon (http://xml.apache.org/cocoon), which you can use
        to
        > generate PDF files from XML on the fly, over the web.
        >
        > I hope this helps -
        >
        > Michael
        >
        >
        > -----Original Message-----
        > From: araffoul [mailto:araffoul@y...]
        > Sent: Monday, June 02, 2003 3:18 PM
        > To: XSL-FO
        > Cc: araffoul
        > Subject: [XSL-FO] Re: embedded HTML in XML - PDF conversion
        >
        >
        > It is easy to output XML nodes containg HTML using XSL because the
        > end result is HTML. I'm doing this as follows:
        >
        > <xsl:value-of select="Notes_E" disable-output-escaping="yes"/>
        >
        > disable-output-escaping="yes" will preserve all HTML. However since
        I
        > want to produce PDF, I have to basically translate the HTML to XSL-
        FO
        > and than process it to produce the PDF. Coding a translator between
        > HTML to XSL-FO is almost impossible. I'm wondering if there is
        > something already available that I can use. XHTML2FO looks like a
        > good solution. I'm just having a hard time using it.
        >
        > The PDF file has to be also generated on the fly from the web site.
        >
        > I appreciate receiving other suggestions to solving this problem.
        >
        > Thank you,
        >
        > --- In XSL-FO@yahoogroups.com, Dahlquist_Michael/shure@s... wrote:
        > > Why does having HTML tags within your XML prevent you from using
        > XSL-FO
        > > stylesheets? If you're using XSL to output HTML, I'd think you
        > could
        > > use XSL-FO to output FO->PDF. Though I may be missing something,
        > too.
        > >
        > > Michael
        > >
        > >
        > > -----Original Message-----
        > > From: araffoul [mailto:araffoul@y...]
        > > Sent: Monday, June 02, 2003 2:57 PM
        > > To: XSL-FO
        > > Cc: araffoul
        > > Subject: [XSL-FO] Re: embedded HTML in XML - PDF conversion
        > >
        > >
        > > Sorry, I may have misled you.
        > >
        > > I'm generating XML file from a SQL database than using XSL
        > producing
        > > HTML. I would also like to produce PDF files. The problem I'm
        > having
        > > is some nodes within the XML document contain formatted data
        using
        > > HTML tags. Therefore it is not possible for me to create XSL-FO
        > > stylesheets for producing PDF because of the HTML content of some
        > > nodes.
        > >
        > > Therefore I though that I can potentially break the problem in
        two:
        > > 1- Generate XSL-FO to process the "normal" XML nodes (nodes not
        > > containing HTML)
        > > 2- For nodes that contain HTML process them through another
        > interface
        > > that can potentially generate the XSL-FO.
        > >
        > > In theory I should be able to process the resulting HTML file
        from
        > > the original XML and XSL to produce the XSL-FO. However, I think
        > that
        > > it will be more efficient to produce the XSL-FO manually because
        I
        > > have more control over the display.
        > >
        > > Does this sound ok? Is there something missing.
        > >
        > > Thank you again.
        > > --- In XSL-FO@yahoogroups.com, "G. Ken Holman" <gkholman@c...>
        > wrote:
        > > > At 2003-06-02 19:26 +0000, araffoul wrote:
        > > > >Actually I'm looking at this solution, however I don't know
        how
        > to
        > > > >use it.
        > > >
        > > > If you are unaware of XSL-FO and stylesheets, why is it you
        think
        > > you need
        > > > XSL-FO? Are you sure you are looking for the information that
        > you
        > > > need? Perhaps you are confusing XSL-FO with something else
        that
        > > you need.
        > > >
        > > > >Assume I have an HTML File called test.html. How do I send it
        > > through
        > > > >xhtml2fo for formatting.
        > > >
        > > > xhtml2fo is an XSLT stylesheet for use with XML inputs, so you
        > > would use it
        > > > as you would use any other XSLT stylesheet:
        > > >
        > > > (1) - convert your HTML to XHTML
        > > > - perhaps using http://tidy.sf.net for conversion
        > > >
        > > > (2) - use XSLT to convert XHTML to XSL-FO
        > > >
        > > > (3) - use an XSL-FO engine to create the formatted output
        > > > - the engine might even incorporate (2) as Antenna House
        does
        > > >
        > > > And please learn more about what XSL-FO is and where it is used
        > > from web
        > > > sites or even from the free preview of our book that is
        available
        > > off our
        > > > web site.
        > > >
        > > > I hope this helps.
        > > >
        > > > ................... Ken
        > > >
        > > >
        > > > --
        > > > Upcoming hands-on courses: (registration still open!)
        > > > - (XSLT/XPath and/or XSL-FO) North America: June 16-20,
        2003
        > > >
        > > > G. Ken Holman mailto:gkholman@C...
        > > > Crane Softwrights Ltd.
        http://www.CraneSoftwrights.com/f/
        > > > Box 266, Kars, Ontario CANADA K0A-2E0 +1(613)489-0999 (F:-
        0995)
        > > > ISBN 0-13-065196-6 Definitive XSLT and
        XPath
        > > > ISBN 0-13-140374-5 Definitive XSL-
        FO
        > > > ISBN 1-894049-08-X Practical Transformation Using XSLT and
        XPath
        > > > ISBN 1-894049-11-X Practical Formatting Using XSL-
        FO
        > > > Member of the XML Guild of Practitioners:
        http://XMLGuild.info
        > > > Male Breast Cancer Awareness
        http://www.CraneSoftwrights.com/f/bc
        > >
        > >
        > >
        > > To unsubscribe from this group, send an email to:
        > > XSL-FO-unsubscribe@egroups.com
        > >
        > >
        > >
        > > Your use of Yahoo! Groups is subject to
        > > http://docs.yahoo.com/info/terms/
        >
        >
        >
        > To unsubscribe from this group, send an email to:
        > XSL-FO-unsubscribe@egroups.com
        >
        >
        >
        > Your use of Yahoo! Groups is subject to
        > http://docs.yahoo.com/info/terms/



        To unsubscribe from this group, send an email to:
        XSL-FO-unsubscribe@egroups.com



        Your use of Yahoo! Groups is subject to
        http://docs.yahoo.com/info/terms/
      Your message has been successfully submitted and would be delivered to recipients shortly.