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

Re: [XSL-FO] Static content dependant on page content

Expand Messages
  • W. Eliot Kimber
    ... I wonder if you could something with z-index, such that you retrieve all the values into the same physical area (using absolutely-positioned block
    Message 1 of 16 , Dec 2, 2003
    • 0 Attachment
      G. Ken Holman wrote:

      > Hi Mike!
      >
      > At 2003-12-02 14:24 -0500, Grimley Michael J NPRI wrote:
      >
      >>My source XML instance contains a sequence of <Instruction> elements, each
      >>having a 'Status' attribute that contains one of the values
      >>'Changed'|'Unchanged'.
      >>...
      >>If the page satisfies conditions 1 or 2, I need to print 'Changed' in the
      >>Header/Footer. If the page satisfies condition 3, I need to print 'Unchanged'.
      >>
      >>I realize I will be using fo:marker, but cannot figure out how to limit
      >>the evaluation of the 'Status' attributes to the printed page when setting
      >>the marker's value.
      >
      >
      > Limiting the *retrieval* of the marker can be done on a page boundary by
      > using retrieve-boundary, but you cannot *evaluate* the marker on any
      > boundary other than those calculated during your transformation. Page
      > boundaries are not known at transformation time, so you can't set anything
      > the way that you ask.

      I wonder if you could something with z-index, such that you retrieve all
      the values into the same physical area (using absolutely-positioned
      block containers with an opaque background color) and then set the
      z-index of "changed" is higher than the z-index of "Unchanged"? If there
      are any "changed" blocks, then they would overlay the unchanged blocks.

      This might work with XEP or XSL Formatter, but I haven't tried it.

      Cheers,

      E.
      --
      W. Eliot Kimber
      Innodata Isogen
      eliot@...
      www.isogen.com
    • Grimley Michael J NPRI
      Hi Ken! (I m always amazed at how you find the time to wear all your different hats *and* participate in these lists...) ... Are you suggesting displaying
      Message 2 of 16 , Dec 2, 2003
      • 0 Attachment
        Hi Ken! (I'm always amazed at how you find the time to wear all your different hats *and* participate in these lists...)

        > The work-around I've given in the past is
        > to retrieve all possible values present and let the human being filtering
        > the pages determine the highest from what they see. Not perfect, but it works.

        Are you suggesting displaying 'Changed' and 'Unchanged' in the header/footer of every page where either may occur? or am I missing something?

        Also, the implication seems to be that I would not even be able to determine if one @Status='Changed' appears on the page, correct?

        Thanks,
        Mike

        -----Original Message-----
        From: G. Ken Holman [mailto:gkholman@...]
        Sent: Tuesday, 02 December 2003 15 34
        To: XSL-FO@yahoogroups.com
        Subject: Re: [XSL-FO] Static content dependant on page content


        Hi Mike!

        At 2003-12-02 14:24 -0500, Grimley Michael J NPRI wrote:
        >My source XML instance contains a sequence of <Instruction> elements, each
        >having a 'Status' attribute that contains one of the values
        >'Changed'|'Unchanged'.
        >...
        >If the page satisfies conditions 1 or 2, I need to print 'Changed' in the
        >Header/Footer. If the page satisfies condition 3, I need to print 'Unchanged'.
        >
        >I realize I will be using fo:marker, but cannot figure out how to limit
        >the evaluation of the 'Status' attributes to the printed page when setting
        >the marker's value.

        Limiting the *retrieval* of the marker can be done on a page boundary by
        using retrieve-boundary, but you cannot *evaluate* the marker on any
        boundary other than those calculated during your transformation. Page
        boundaries are not known at transformation time, so you can't set anything
        the way that you ask.

        Yours is another example of arbitrating between markers found on a page,
        such as needed to "percolate" to the top of a page the highest of a range
        of security markers found in the page's content: "confidential", "secret"
        and "top secret". You can retrieve each of these individually, but you
        cannot arbitrate between them. The work-around I've given in the past is
        to retrieve all possible values present and let the human being filtering
        the pages determine the highest from what they see. Not perfect, but it works.

        XSL-FO 1.0 has no arbitration of retrieved markers ... I don't know if it
        might be coming in a 1.1 or later release.

        I hope this helps (though I realize I've told you you can't do what you
        want to do!).

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


        --
        Next public European delivery: 3-day XSLT/2-day XSL-FO 2004-01-??
        Instructor-led on-site corporate, government & user group training
        for XSLT and XSL-FO world-wide: please contact us for the details

        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-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/
      • G. Ken Holman
        ... Since you have contrasting values, it wouldn t look very good, but yes ... the human reader would give a priority to the presence of one, as would the
        Message 3 of 16 , Dec 2, 2003
        • 0 Attachment
          At 2003-12-02 16:15 -0500, you wrote:
          > > The work-around I've given in the past is
          > > to retrieve all possible values present and let the human being filtering
          > > the pages determine the highest from what they see. Not perfect, but
          > it works.
          >
          >Are you suggesting displaying 'Changed' and 'Unchanged' in the
          >header/footer of every page where either may occur? or am I missing something?

          Since you have contrasting values, it wouldn't look very good, but yes ...
          the human reader would give a "priority" to the presence of one, as would
          the reader of three levels of security on a page.

          >Also, the implication seems to be that I would not even be able to
          >determine if one @Status='Changed' appears on the page, correct?

          Right ... "determination" typically happens in XSLT because only very few
          determinations can be made by the XSL-FO processor. The XSL-FO processor
          can determine which markers are on a page, but you can't determine that
          during transformation, so you can't decide between them.

          Eliot's clever idea is worth exploring!

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

          --
          Next public European delivery: 3-day XSLT/2-day XSL-FO 2004-01-??
          Instructor-led on-site corporate, government & user group training
          for XSLT and XSL-FO world-wide: please contact us for the details

          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-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
        • Grimley Michael J NPRI
          ... I think in my case, because it is a binary choice, I ll be better off displaying Changed when one exists on the page and just displaying nothing when
          Message 4 of 16 , Dec 2, 2003
          • 0 Attachment
            G. Ken Holman wrote:
            > Since you have contrasting values, it wouldn't look very good, but yes ...
            > the human reader would give a "priority" to the presence of one, as would
            > the reader of three levels of security on a page.

            I think in my case, because it is a binary choice, I'll be better off displaying 'Changed' when one exists on the page and just displaying nothing when there are none (nothing implies 'Unchanged'). That's what I'm doing now.

            > Eliot's clever idea is worth exploring!

            I'll be trying that out as soon as I can; I'll post my results.

            Thank You Much,
            Mike
          • G. Ken Holman
            ... Bingo! Well done, Eliot, it works like a charm with Antenna House! I created a number of blocks with markers for each of three levels: classified ,
            Message 5 of 16 , Dec 2, 2003
            • 0 Attachment
              At 2003-12-02 15:07 -0600, W. Eliot Kimber wrote:
              >G. Ken Holman wrote:
              > > Limiting the *retrieval* of the marker can be done on a page boundary by
              > > using retrieve-boundary, but you cannot *evaluate* the marker on any
              > > boundary other than those calculated during your transformation. Page
              > > boundaries are not known at transformation time, so you can't set anything
              > > the way that you ask.
              >
              >I wonder if you could something with z-index, such that you retrieve all
              >the values into the same physical area (using absolutely-positioned
              >block containers with an opaque background color)

              Bingo! Well done, Eliot, it works like a charm with Antenna House! I
              created a number of blocks with markers for each of three levels:
              "classified", "secret" and "top secret". I used three numeric values for
              the z-index and used your suggestion and it looks seamless: only the
              highest of the three present on the page, if present, show up on the
              printed output.

              Thanks!

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


              --
              Next public European delivery: 3-day XSLT/2-day XSL-FO 2004-01-??
              Instructor-led on-site corporate, government & user group training
              for XSLT and XSL-FO world-wide: please contact us for the details

              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-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
            • W. Eliot Kimber
              ... Cool. Until now I thought this was impossible. Thanks for trying it out. Cheers, E. -- W. Eliot Kimber Innodata Isogen eliot@isogen.com www.isogen.com
              Message 6 of 16 , Dec 2, 2003
              • 0 Attachment
                G. Ken Holman wrote:

                > At 2003-12-02 15:07 -0600, W. Eliot Kimber wrote:
                >
                >>G. Ken Holman wrote:
                >>
                >>>Limiting the *retrieval* of the marker can be done on a page boundary by
                >>>using retrieve-boundary, but you cannot *evaluate* the marker on any
                >>>boundary other than those calculated during your transformation. Page
                >>>boundaries are not known at transformation time, so you can't set anything
                >>>the way that you ask.
                >>
                >>I wonder if you could something with z-index, such that you retrieve all
                >>the values into the same physical area (using absolutely-positioned
                >>block containers with an opaque background color)
                >
                >
                > Bingo! Well done, Eliot, it works like a charm with Antenna House! I
                > created a number of blocks with markers for each of three levels:
                > "classified", "secret" and "top secret". I used three numeric values for
                > the z-index and used your suggestion and it looks seamless: only the
                > highest of the three present on the page, if present, show up on the
                > printed output.

                Cool. Until now I thought this was impossible. Thanks for trying it out.

                Cheers,

                E.

                --
                W. Eliot Kimber
                Innodata Isogen
                eliot@...
                www.isogen.com
              • G. Ken Holman
                ... Me too ... so I ve now added this to Chapter 12 of my book, included a running example, and attributed you as the source for the strategy. Mike, for your
                Message 7 of 16 , Dec 2, 2003
                • 0 Attachment
                  At 2003-12-02 16:52 -0600, W. Eliot Kimber wrote:
                  >Cool. Until now I thought this was impossible.

                  Me too ... so I've now added this to Chapter 12 of my book, included a
                  running example, and attributed you as the source for the strategy.

                  Mike, for your example, just co-locate two absolutely-positioned block
                  containers in your static content, one with a fixed string "Unchanged" and
                  the other with an opaque background and retrieve the maker class that
                  defines the string "Changed". When not present on a page, the "Unchanged"
                  will appear, and when present, it will obscure it.

                  Thanks!

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


                  --
                  Next public European delivery: 3-day XSLT/2-day XSL-FO 2004-01-??
                  Instructor-led on-site corporate, government & user group training
                  for XSLT and XSL-FO world-wide: please contact us for the details

                  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-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
                • Grimley Michael J NPRI
                  ... Also works with XEP 3.6. Thank you both very much! Mike Grimley
                  Message 8 of 16 , Dec 3, 2003
                  • 0 Attachment
                    G. Ken Holman wrote:
                    > Bingo! Well done, Eliot, it works like a charm with Antenna House!

                    Also works with XEP 3.6.

                    Thank you both very much!

                    Mike Grimley
                  • Alexander Peshkov
                    Hello Grimley, GMJN Also works with XEP 3.6. It can sound a bit surprising since XEP do not support z-index . :-) Actually every following block-container
                    Message 9 of 16 , Dec 3, 2003
                    • 0 Attachment
                      Hello Grimley,

                      GMJN> Also works with XEP 3.6.

                      It can sound a bit surprising since XEP do not support 'z-index'. :-)
                      Actually every following block-container will eclipse previous one in
                      the order of retrieve-markers. So I suppose you have first
                      retrieve-marker with class 'unchanged' and second retrieve-marker with
                      class 'changed' - in this case the latter one will mask the former
                      one. I believe that in such a way you can achieve required
                      functionality without any z-indexes with any number of classes.

                      Best regards,
                      Alexander Peshkov mailto:peshkov@...
                      RenderX


                      GMJN> Thank you both very much!

                      GMJN> Mike Grimley
                    • Grimley Michael J NPRI
                      Hello Peshkov, AP It can sound a bit surprising since XEP do not support z-index . :- Actually, I didn t use z-index; I simply layered them as you indicate.
                      Message 10 of 16 , Dec 3, 2003
                      • 0 Attachment
                        Hello Peshkov,

                        AP> It can sound a bit surprising since XEP do not support 'z-index'. :-

                        Actually, I didn't use z-index; I simply layered them as you indicate.


                        Mike

                        -----Original Message-----
                        From: Alexander Peshkov [mailto:peshkov@...]
                        Sent: Wednesday, 03 December 2003 10 30
                        To: Grimley Michael J NPRI
                        Cc: 'XSL-FO@yahoogroups.com'
                        Subject: Re[2]: [XSL-FO] Static content dependant on page content


                        Hello Grimley,

                        GMJN> Also works with XEP 3.6.

                        It can sound a bit surprising since XEP do not support 'z-index'. :-)
                        Actually every following block-container will eclipse previous one in
                        the order of retrieve-markers. So I suppose you have first
                        retrieve-marker with class 'unchanged' and second retrieve-marker with
                        class 'changed' - in this case the latter one will mask the former
                        one. I believe that in such a way you can achieve required
                        functionality without any z-indexes with any number of classes.

                        Best regards,
                        Alexander Peshkov mailto:peshkov@...
                        RenderX


                        GMJN> Thank you both very much!

                        GMJN> Mike Grimley
                      • David Tolpin
                        ... So, what s the code? Does one have to have fo:retrieve-markers in the order of accending precedence? Then if there is a marker to retrieve the latest
                        Message 11 of 16 , Dec 3, 2003
                        • 0 Attachment
                          > It can sound a bit surprising since XEP do not support 'z-index'. :-)
                          > Actually every following block-container will eclipse previous one in
                          > the order of retrieve-markers. So I suppose you have first
                          > retrieve-marker with class 'unchanged' and second retrieve-marker with
                          > class 'changed' - in this case the latter one will mask the former
                          > one. I believe that in such a way you can achieve required
                          > functionality without any z-indexes with any number of classes.

                          So, what's the code?

                          Does one have to have fo:retrieve-markers in the order of accending precedence?
                          Then if there is a marker to retrieve the latest retrieved will generate an
                          absolute container on top of the rest?

                          Nice idea, really. That way the order of importance is specified explicitely
                          and in the same place; z-index is not needed.

                          David Tolpin
                        • Alexander Peshkov
                          Hello David, DT So, what s the code? Markers:
                          Message 12 of 16 , Dec 3, 2003
                          • 0 Attachment
                            Hello David,

                            DT> So, what's the code?

                            Markers:
                            <fo:marker marker-class-name="unchanged">
                            <fo:block-container position="absolute" top="0.5in" left="1in" width="2in" height="0.5in" background-color="white">
                            <fo:block>**unchanged**</fo:block>
                            </fo:block-container>
                            </fo:marker>

                            <fo:marker marker-class-name="changed">
                            <fo:block-container position="absolute" top="0.5in" left="1in" width="2in" height="0.5in" background-color="white">
                            <fo:block>++changed++</fo:block>
                            </fo:block-container>
                            </fo:marker>

                            Static content:
                            <fo:static-content flow-name="xsl-region-before">
                            <fo:retrieve-marker retrieve-class-name="unchanged" retrieve-position="first-including-carryover" retrieve-boundary="page"/>
                            <fo:retrieve-marker retrieve-class-name="changed" retrieve-position="first-including-carryover" retrieve-boundary="page"/>
                            </fo:static-content>


                            DT> Does one have to have fo:retrieve-markers in the order of accending precedence?

                            Yes.

                            DT> Then if there is a marker to retrieve the latest retrieved will generate an
                            DT> absolute container on top of the rest?

                            Yes.

                            DT> Nice idea, really. That way the order of importance is specified explicitely
                            DT> and in the same place; z-index is not needed.

                            That's just what I was saying. :-)

                            DT> David Tolpin

                            Best regards,
                            Alexander Peshkov mailto:peshkov@...
                            RenderX
                          • Grimley Michael J NPRI
                            Because I simply have a choice of two, I have the block displaying Unchanged by default. I only set the marker if the status of an instruction is Changed .
                            Message 13 of 16 , Dec 3, 2003
                            • 0 Attachment
                              Because I simply have a choice of two, I have the block displaying 'Unchanged' by default. I only set the marker if the status of an instruction is 'Changed'. If there is a 'Changed' marker, it simply covers the default.

                              <fo:static-content flow-name="EvenPage-header">
                              <fo:block-container height="30pt" position="fixed" top="2.5pc" text-align="center">
                              <fo:block xsl:use-attribute-sets="Status">Unchanged</fo:block>
                              </fo:block-container>
                              <fo:block-container height="30pt" position="fixed" top="2.5pc" text-align="center">
                              <fo:retrieve-marker retrieve-class-name="Status" retrieve-position="first-including-carryover" retrieve-boundary="page"/>
                              </fo:block-container>
                              </fo:static-content>

                              Mike Grimley

                              -----Original Message-----
                              From: David Tolpin [mailto:dvd@...]
                              Sent: Wednesday, 03 December 2003 11 06
                              To: XSL-FO@yahoogroups.com
                              Subject: Re: Re[2]: [XSL-FO] Static content dependant on page content


                              > It can sound a bit surprising since XEP do not support 'z-index'. :-)
                              > Actually every following block-container will eclipse previous one in
                              > the order of retrieve-markers. So I suppose you have first
                              > retrieve-marker with class 'unchanged' and second retrieve-marker with
                              > class 'changed' - in this case the latter one will mask the former
                              > one. I believe that in such a way you can achieve required
                              > functionality without any z-indexes with any number of classes.

                              So, what's the code?

                              Does one have to have fo:retrieve-markers in the order of accending precedence?
                              Then if there is a marker to retrieve the latest retrieved will generate an
                              absolute container on top of the rest?

                              Nice idea, really. That way the order of importance is specified explicitely
                              and in the same place; z-index is not needed.

                              David Tolpin


                              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/
                            • J.Pietschmann
                              ... The FOP distribution has an example for this (in examples/fo/markers/hide.fo) although it has to use an SVG for hiding because of FOP restrictions at the
                              Message 14 of 16 , Dec 3, 2003
                              • 0 Attachment
                                G. Ken Holman wrote:
                                > Mike, for your example, just co-locate two absolutely-positioned block
                                > containers in your static content, one with a fixed string "Unchanged" and
                                > the other with an opaque background and retrieve the maker class that
                                > defines the string "Changed". When not present on a page, the "Unchanged"
                                > will appear, and when present, it will obscure it.

                                The FOP distribution has an example for this (in examples/fo/markers/hide.fo)
                                although it has to use an SVG for hiding because of FOP restrictions at the
                                time the example was provided.

                                J.Pietschmann
                              Your message has been successfully submitted and would be delivered to recipients shortly.