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

Re: [XSL-FO] Align by decimal place

Expand Messages
  • G. Ken Holman
    Thanks for commenting on the format of the property. ... I looked where you cited and I see no examples of the use of a string argument. I checked the CSS
    Message 1 of 6 , Jun 9, 2004
    • 0 Attachment
      Thanks for commenting on the format of the property.

      At 2004-06-09 20:52 +0200, J.Pietschmann wrote:
      >eentenman wrote:
      > > I am trying to figure out a way to align text inside table cells by
      > > the decimal point.
      >
      >You can use
      > text-align="'.'"
      >on the tabel cells. Note the inner quotes which is necessary
      >for the FO processor to recognize it as a string. See
      > http://www.w3.org/TR/xsl/slice7.html#text-align
      >for more info.

      I looked where you cited and I see no examples of the use of a string argument.

      I checked the CSS citation and saw in the syntax of the CSS stylesheet the
      use of quotes, but I thought that was an artifact of the CSS stylesheet syntax.

      Looking at XSL-FO section 5.11 I note the description of <string> to be:

      "A sequence of characters"

      ... which does not imply the need for quotes ... though I will admit that
      if the alignment string were the word "left" you would need to say "'left'"
      in order to distinguish from "left".

      But ... can anyone cite chapter and verse of XSL-FO that <string> *must* be
      quoted inside the attribute value?

      Thanks!

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

      --
      Public courses: Spring 2004 world tour of hands-on XSL instruction
      Next: 3-day XSLT/XPath; 2-day XSL-FO - Birmingham, UK June 14,2004

      World-wide on-site corporate, govt. & user group XML/XSL training.
      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)
      Male Breast Cancer Awareness http://www.CraneSoftwrights.com/f/bc
      Legal business disclaimers: http://www.CraneSoftwrights.com/legal
    • J.Pietschmann
      ... Really? 7.15.9 text-align Value: start | center | end | justify | inside | outside | left | right ... The in the angle brackets is really meant
      Message 2 of 6 , Jun 10, 2004
      • 0 Attachment
        G. Ken Holman wrote:
        > I looked where you cited and I see no examples of the use of a string argument.

        Really?
        7.15.9 "text-align"
        Value: start | center | end | justify | inside | outside | left | right
        | <string> | inherit
        The <string> in the angle brackets is really meant to be an XSLFO
        property expression string, I think, while all the other values are
        enumeration tokens.
        Well, they *could* have been a bit more clear.

        > I checked the CSS citation and saw in the syntax of the CSS stylesheet the
        > use of quotes, but I thought that was an artifact of the CSS stylesheet syntax.
        >
        > Looking at XSL-FO section 5.11 I note the description of <string> to be:
        >
        > "A sequence of characters"
        >
        > ... which does not imply the need for quotes ... though I will admit that
        > if the alignment string were the word "left" you would need to say "'left'"
        > in order to distinguish from "left".

        Section 5.9.8 Strings (lexical structure of property expressions):
        "Strings are represented either as literals or as an enumeration token."
        The string literal is cross referenced to the production:
        [20] Literal ::= '"' [^"]* '"' | "'" [^']* "'"
        (see slice5.html#NT-Literal). These quotes are supposed to be inside
        the XML attribute, like for XSLT strings.
        But then, there is the following in 5.9.8:
        "All properties contexts allow conversion from enumeration tokens to
        strings"
        which means the XML attribute
        foo="bar"
        would represent a valid FO property expression, yielding the
        enumeration token bar which may be implicitly converted to the string
        "bar".
        OTOH, an enumeration token is supposed to be a NCName, and a single
        dot is not a NCName (but a single underline character is). Hence
        the need for the quotes. Or so I believe.

        I remember the discussion regarding page number formats:
        <fo:page-sequence format="01" ...
        The expression will be parsed as number, but because the format is
        expected to be a string and in contrast to XPath XSLFO numbers
        can't be implicitely converted into a string, the property is in
        error (and even if implicit conversion was allowed, it would drop
        the leading zero). The errata allow the FO processor specifically
        for this use case to fall back to use the original string value
        of the XML atribute, after trimming leading and trailing whitespace,
        otherwise everybody would be forced to write
        <fo:page-sequence format="'01'" ...
        Duh!

        And I really like the specification of the hyphenation character:
        7.9.5 "hyphenation-character"
        Value: <character> | inherit
        Yeah, chapter 5 doesn't include a specification for a lexical character,
        nor do the errata. This begs the question whether
        <fo:block hyphenation-character="-">
        is really meant to be written this way, because the only plausible
        interpretation of <character> would be "a string consisting of
        a single character". And what about
        <fo:block hyphenation-character="....">
        Yes, four ASCII dots. Why shouldn't this be allowed?

        I'm reminded of the most renowned example of "specification by
        implementation", the C preprocessor - simple, intuitive syntax,
        straightforward implementation, but leading to an utterly convoluted
        formal description for the sake of getting rid of the "dark corners"
        (which makes the quite innocently looking expression 0xE-0xA an invalid
        PP token).

        Specs with holes suck. But then, I've dealt with texts which were much,
        much worse.
        I hope they fix the property expression grammar and the individual
        property specs in XSLFO 2.0

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