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

Re: [XSL-FO] Single XSL for both pdf and html

Expand Messages
  • Klaas_Bals@inventivedesigners.com
    ... I m sorry. I don t agree that this is a trivial question. I would be possible to generate XHTML from an XSL-FO document. If they can create text and rtf,
    Message 1 of 13 , Mar 6, 2003
    • 0 Attachment
      >> Hi All,
      >>
      >> Is it possible to write single xsl which produces output in both pdf and
      >> html.
      >
      >An analogy of what you're asking would perhaps be to ask:
      >
      >"I have two white doors that need painting, one needs to be green and the
      >other red. Is it possible to buy one single can of paint for me to use?"

      I'm sorry. I don't agree that this is a trivial question. I would be
      possible to generate XHTML from an XSL-FO document. If they can create text
      and rtf, XHTML is also possible!


      -----
      Klaas Bals - Scriptura Development Manager

      Scriptura - a WYSIWYG XSL-FO editor: www.inventivedesigners.com/scriptura

      Inventive Designers
      Direct Phone: +32 - 3 - 8210183
      Office Phone: +32 - 3 - 8210170
      Office Fax: +32 - 3 - 8210171
      Email: Klaas_Bals at inventivedesigners dot com
    • Rob Stote
      I agree Klass: this is a valid question, anybody that would answer this way is not being very polite, and trust me I am being polite now Rob ... From:
      Message 2 of 13 , Mar 6, 2003
      • 0 Attachment
        I agree Klass:
        this is a valid question, anybody that would answer this way is not being
        very polite, and trust me I am being polite now

        Rob

        -----Original Message-----
        From: Klaas_Bals@...
        [mailto:Klaas_Bals@...]
        Sent: March 6, 2003 5:27 PM
        To: XSL-FO@yahoogroups.com
        Subject: Re: [XSL-FO] Single XSL for both pdf and html



        >> Hi All,
        >>
        >> Is it possible to write single xsl which produces output in both pdf and
        >> html.
        >
        >An analogy of what you're asking would perhaps be to ask:
        >
        >"I have two white doors that need painting, one needs to be green and the
        >other red. Is it possible to buy one single can of paint for me to use?"

        I'm sorry. I don't agree that this is a trivial question. I would be
        possible to generate XHTML from an XSL-FO document. If they can create text
        and rtf, XHTML is also possible!


        -----
        Klaas Bals - Scriptura Development Manager

        Scriptura - a WYSIWYG XSL-FO editor: www.inventivedesigners.com/scriptura

        Inventive Designers
        Direct Phone: +32 - 3 - 8210183
        Office Phone: +32 - 3 - 8210170
        Office Fax: +32 - 3 - 8210171
        Email: Klaas_Bals at inventivedesigners dot com



        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/



        [Non-text portions of this message have been removed]
      • G. Ken Holman
        ... In my stylesheet library for OASIS UBL documents I go the other way: I generate XSL-FO as my master and then use the fo2html.xsl stylesheet from RenderX
        Message 3 of 13 , Mar 6, 2003
        • 0 Attachment
          At 2003-03-06 11:26 -0800, Jim White wrote:
          >Chitra Muthukrishnan wrote:
          > > Is it possible to write single xsl which produces output in both pdf and
          > > html.
          >
          >I do that by running an XSL to generate (X)HTML and then run a
          >XHTML-to-FO XSL. The xhtml2fo.xsl that I use is a heavily customized
          >version of the sample from Antenna House:

          In my stylesheet library for OASIS UBL documents I go the other way: I
          generate XSL-FO as my "master" and then use the fo2html.xsl stylesheet from
          RenderX to make the HTML rendition of the XSL-FO instance generated from
          the UBL XML.

          The running stylesheets are available to be downloaded under the modified
          BSD license from the free resource area of our web site.

          I hope this helps.

          .................. Ken


          --
          Upcoming hands-on in-depth XSLT/XPath and/or XSL-FO
          North America: June 16-20, 2003

          G. Ken Holman mailto:gkholman@...
          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-10-1 Practical Formatting Using XSL-FO
          Male Breast Cancer Awareness http://www.CraneSoftwrights.com/f/bc
        • Kurt Cagle
          Actually I agree with the last -- there s no reason why you couldn t write an XSLT that generates to XSL-FO or XHTML depending upon a modal switch, something
          Message 4 of 13 , Mar 6, 2003
          • 0 Attachment
            Actually I agree with the last -- there's no reason why you couldn't write an
            XSLT that generates to XSL-FO or XHTML depending upon a modal switch,
            something along the lines of:

            <xsl:param name="target" select="'XSL-FO'"/>

            <xsl:template match="/">
            <xsl:choose>
            <xsl:when test="target='XSL-FO' ">
            <xsl:apply-templates select="*" mode="xslfo"/>
            </xsl:when>
            <xsl:otherwise>
            <xsl:apply-templates select="*" mode="xhtml"/>
            </xsl:otherwise>
            </xsl:choose>
            </xsl:template>

            This makes more sense in XSLT2, where you might be generating a result
            document as a secondary stream, but there are ample precedents for doing
            this.

            -- Kurt

            On Thursday 06 March 2003 01:26 pm, Klaas_Bals@... wrote:
            > >> Hi All,
            > >>
            > >> Is it possible to write single xsl which produces output in both pdf
            > >> and html.
            > >
            > >An analogy of what you're asking would perhaps be to ask:
            > >
            > >"I have two white doors that need painting, one needs to be green and the
            > >other red. Is it possible to buy one single can of paint for me to use?"
            >
            > I'm sorry. I don't agree that this is a trivial question. I would be
            > possible to generate XHTML from an XSL-FO document. If they can create
            > text and rtf, XHTML is also possible!
          • Ian Tindale
            ... That s a erroneous generalisation - I was being polite. I m not now, though. Now I am. Now I m not. Now I ve lost count. The thing is, if your output
            Message 5 of 13 , Mar 6, 2003
            • 0 Attachment
              On Thursday 06 March 2003 10:12 pm, Rob Stote wrote:
              > I agree Klass:
              > this is a valid question, anybody that would answer this way is not being
              > very polite, and trust me I am being polite now

              That's a erroneous generalisation - I was being polite. I'm not now, though.
              Now I am. Now I'm not. Now I've lost count.

              The thing is, if your output across XHTML and PDF were extremely similar in
              layout, then academically, you could narrow down the branching point to more
              or less within the XSLT. In most cases, though, you'd be advised to take
              advantage of designing for the media, even down to simple but major things
              such as colour choice, page size assumption, and media content. Typically, in
              a scenario such as, for example, Cocoon, you'd find that the branch is quite
              distinct and once content negotiation has had its say, the XSLT chosen is
              quite discrete from any of the other media choices available.

              To return to the analogy, if one were to concoct a tin of paint that is both
              green and red, one would inevitably find that it is not really either green
              or red enough to be either - more of a compromise from the beginning.
              --
              Ian Tindale
            • Christian Duschl
              I m not sure if I understand your question (I m sure that its possible to generate html and pdf or anything else with the same stylesheet .. does it make
              Message 6 of 13 , Mar 6, 2003
              • 0 Attachment
                I'm not sure if I understand your question (I'm sure that its possible to generate html and pdf or anything else with the same stylesheet .. does it make sense ?), but if you just want to prduce html from fo- codebase, you might have a look at www.x-form.de.
                This product generates html,rtf,pdf... from fo (based on fop with addititonal renderers).
                You've to speak german to read the pages (english version will soon be available).
                ----- Original Message -----
                From: Ian Tindale
                To: XSL-FO@yahoogroups.com
                Sent: Friday, March 07, 2003 1:07 AM
                Subject: Re: [XSL-FO] Single XSL for both pdf and html


                On Thursday 06 March 2003 10:12 pm, Rob Stote wrote:
                > I agree Klass:
                > this is a valid question, anybody that would answer this way is not being
                > very polite, and trust me I am being polite now

                That's a erroneous generalisation - I was being polite. I'm not now, though.
                Now I am. Now I'm not. Now I've lost count.

                The thing is, if your output across XHTML and PDF were extremely similar in
                layout, then academically, you could narrow down the branching point to more
                or less within the XSLT. In most cases, though, you'd be advised to take
                advantage of designing for the media, even down to simple but major things
                such as colour choice, page size assumption, and media content. Typically, in
                a scenario such as, for example, Cocoon, you'd find that the branch is quite
                distinct and once content negotiation has had its say, the XSLT chosen is
                quite discrete from any of the other media choices available.

                To return to the analogy, if one were to concoct a tin of paint that is both
                green and red, one would inevitably find that it is not really either green
                or red enough to be either - more of a compromise from the beginning.
                --
                Ian Tindale

                Yahoo! Groups Sponsor
                ADVERTISEMENT




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



                Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


                [Non-text portions of this message have been removed]
              • Ian Tindale
                ... No it wasn t so much that, it was a query by the original poster that asked if it were possible to write a single XSL stylesheet which produces output in
                Message 7 of 13 , Mar 7, 2003
                • 0 Attachment
                  On Friday 07 March 2003 7:42 am, Christian Duschl wrote:
                  > I'm not sure if I understand your question (I'm sure that its possible to
                  > generate html and pdf or anything else with the same stylesheet .. does it
                  > make sense ?),

                  No it wasn't so much that, it was a query by the original poster that asked if
                  it were possible to write a single XSL stylesheet which produces output in
                  both PDF and HTML.

                  I would say no, as a matter of style. Of course, you could have a single XSL
                  that outputs both a PDF and HTML output simultaneously - just bolt the guts
                  of a PDF XSLT onto the guts of an HTML transformation and whenever the
                  transformation is run, you get two discrete output products. However, that's
                  basically the same as running first one (a PDF transformation), then the
                  other (the HTML tranformation) as a simple chained operation of two discrete
                  transformations.

                  If what you want is a single transformation that simply piles output into a
                  PDF and an HTML document pretty much in the same sweep, you'll lose the
                  flexibility of the individual media, and neither the PDF nor the HTML will
                  have been done justice. If it transpires that each request for PDF is always
                  accompanied by an identical HTML request, I suppose you'd want a single XSLT
                  to do the same job. I'd still, however, push towards triggering the two
                  processes as separate transformations, just finding a way of triggering a
                  pair of requests in one action - and this might as well be outside the XSLT
                  domain.

                  --
                  Ian Tindale
                • Rob Stote
                  agreed: In the end you really need 2 style-sheets. And really should use 2 style-sheets. Rob ps Ian sry, for the generalization, the moment I hit send I was
                  Message 8 of 13 , Mar 7, 2003
                  • 0 Attachment
                    agreed:

                    In the end you really need 2 style-sheets. And really should use 2
                    style-sheets.

                    Rob

                    ps Ian sry, for the generalization, the moment I hit send I was like s%*^t
                    not smart

                    -----Original Message-----
                    From: Ian Tindale [mailto:ian_tindale@...]
                    Sent: March 7, 2003 4:47 AM
                    To: XSL-FO@yahoogroups.com
                    Subject: Re: [XSL-FO] Single XSL for both pdf and html


                    On Friday 07 March 2003 7:42 am, Christian Duschl wrote:
                    > I'm not sure if I understand your question (I'm sure that its possible to
                    > generate html and pdf or anything else with the same stylesheet .. does
                    it
                    > make sense ?),

                    No it wasn't so much that, it was a query by the original poster that asked
                    if
                    it were possible to write a single XSL stylesheet which produces output in
                    both PDF and HTML.

                    I would say no, as a matter of style. Of course, you could have a single XSL

                    that outputs both a PDF and HTML output simultaneously - just bolt the guts
                    of a PDF XSLT onto the guts of an HTML transformation and whenever the
                    transformation is run, you get two discrete output products. However, that's

                    basically the same as running first one (a PDF transformation), then the
                    other (the HTML tranformation) as a simple chained operation of two
                    discrete
                    transformations.

                    If what you want is a single transformation that simply piles output into a
                    PDF and an HTML document pretty much in the same sweep, you'll lose the
                    flexibility of the individual media, and neither the PDF nor the HTML will
                    have been done justice. If it transpires that each request for PDF is always

                    accompanied by an identical HTML request, I suppose you'd want a single XSLT

                    to do the same job. I'd still, however, push towards triggering the two
                    processes as separate transformations, just finding a way of triggering a
                    pair of requests in one action - and this might as well be outside the XSLT
                    domain.

                    --
                    Ian Tindale

                    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/



                    [Non-text portions of this message have been removed]
                  Your message has been successfully submitted and would be delivered to recipients shortly.