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

Re: [XSL-FO] Re: [xsl] Library functions

Expand Messages
  • Nikolai Grigoriev
    Carmelo, ... All examples in the XSL spec refer to an FO processor. While you can can (and should) calculate most values in XSLT, there are cases where the
    Message 1 of 5 , Aug 7, 2001
    • 0 Attachment
      Carmelo,

      > But I think, they intended the "FO" processor to evaluate the
      > function, not the XSLT engine. If I do the curly braces, then
      > the XSLT engine will evaluate the expression, then a number (with
      > a unit) will be passed to the FO Processor. I guess the question now
      > is which processor the specs. intends to evaluate the expression?.

      All examples in the XSL spec refer to an FO processor. While you can
      can (and should) calculate most values in XSLT, there are cases where
      the exact value of a property can only be found during the formatting.
      Examples:

      content-width="max(2in, 50%)"

      Width of an image should be 2 inches or 50% of the parent reference
      area width, whichever is greater. The width of an area is calculated
      during formatting, and depends on page width; you cannot get it in XSLT.

      padding="1em + 3pt"

      Padding is equal to the current font size, plus 3 points. While it is possible
      to calculate the font size in a given point in XSLT, it is hardly worth
      doing: you have to cope with inheritance.

      > The reason I am confused is because the example given inside section
      > 5.10.1 uses units inside the function's argument which is giving
      > the FO processor a real hard time.

      Not necessarily. An XSL FO processor knows length units, and has
      no problems dividing them.

      Regards,
      Nikolai Grigoriev

      RenderX
    • Carmelo Montanez
      Thanks, it makes mare sense now!!! Carmelo ... From: Nikolai Grigoriev To: Sent: Tuesday, August 07, 2001 5:32 PM
      Message 2 of 5 , Aug 7, 2001
      • 0 Attachment
        Thanks, it makes mare sense now!!!

        Carmelo
        ----- Original Message -----
        From: "Nikolai Grigoriev" <grig@...>
        To: <XSL-FO@yahoogroups.com>
        Sent: Tuesday, August 07, 2001 5:32 PM
        Subject: Re: [XSL-FO] Re: [xsl] Library functions


        > Carmelo,
        >
        > > But I think, they intended the "FO" processor to evaluate the
        > > function, not the XSLT engine. If I do the curly braces, then
        > > the XSLT engine will evaluate the expression, then a number (with
        > > a unit) will be passed to the FO Processor. I guess the question now
        > > is which processor the specs. intends to evaluate the expression?.
        >
        > All examples in the XSL spec refer to an FO processor. While you can
        > can (and should) calculate most values in XSLT, there are cases where
        > the exact value of a property can only be found during the formatting.
        > Examples:
        >
        > content-width="max(2in, 50%)"
        >
        > Width of an image should be 2 inches or 50% of the parent reference
        > area width, whichever is greater. The width of an area is calculated
        > during formatting, and depends on page width; you cannot get it in
        XSLT.
        >
        > padding="1em + 3pt"
        >
        > Padding is equal to the current font size, plus 3 points. While it is
        possible
        > to calculate the font size in a given point in XSLT, it is hardly worth
        > doing: you have to cope with inheritance.
        >
        > > The reason I am confused is because the example given inside section
        > > 5.10.1 uses units inside the function's argument which is giving
        > > the FO processor a real hard time.
        >
        > Not necessarily. An XSL FO processor knows length units, and has
        > no problems dividing them.
        >
        > Regards,
        > Nikolai Grigoriev
        >
        > RenderX
        >
        >
        >
        >
        > 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/
        >
        >
        >
      • Nikolai Grigoriev
        Sebastian, ... Because you can have page masters with different widths for e.g. right and left pages. Until you actually format the text, you don t know on
        Message 3 of 5 , Aug 8, 2001
        • 0 Attachment
          Sebastian,

          > Nikolai Grigoriev writes:
          > > content-width="max(2in, 50%)"
          > >
          > > Width of an image should be 2 inches or 50% of the parent reference
          > > area width, whichever is greater. The width of an area is calculated
          > > during formatting, and depends on page width; you cannot get it in XSLT.
          >
          > why cant you work it out from first principles in the XSLT, since you
          > know the page width, and all subsequent dimensions?

          Because you can have page masters with different widths for e.g. right and left
          pages. Until you actually format the text, you don't know on which page
          your image happens to occur.

          > I would find it hard to see why a designer would issue a spec like
          > that, but no matter.

          I admit that my examples are artificial; I never use expressions in real
          stylesheets. The only "practical" application is for centering a table
          of a given width within a page:

          <fo:table width="3in" start-indent="50% - 1.5in">
          ....

          This one is hard to do it without expressions. (Surely, I'd prefer having one
          more attribute for aligning block within another block and not having
          expressions at all...)

          Regards,
          Nikolai
        • Sebastian Rahtz
          ... why cant you work it out from first principles in the XSLT, since you know the page width, and all subsequent dimensions? ... ah yes, there is that.... I
          Message 4 of 5 , Aug 8, 2001
          • 0 Attachment
            Nikolai Grigoriev writes:
            > content-width="max(2in, 50%)"
            >
            > Width of an image should be 2 inches or 50% of the parent reference
            > area width, whichever is greater. The width of an area is calculated
            > during formatting, and depends on page width; you cannot get it in XSLT.

            why cant you work it out from first principles in the XSLT, since you
            know the page width, and all subsequent dimensions?


            > padding="1em + 3pt"
            >
            > Padding is equal to the current font size, plus 3 points. While
            > it is possible to calculate the font size in a given point in
            > XSLT, it is hardly worth doing: you have to cope with
            > inheritance.
            ah yes, there is that....

            I would find it hard to see why a designer would issue a spec like
            that, but no matter.

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