W3C home > Mailing lists > Public > xsl-editors@w3.org > July to September 2001

Re: XSL-FO: Property Expression and immediate value

From: Anders Berglund <alrb@us.ibm.com>
Date: Tue, 3 Jul 2001 12:02:42 -0400
To: MURAKAMI Shinyu <murakami@nadita.com>
Cc: xsl-editors@w3.org
Message-ID: <OF3316325F.7D190FAC-ON85256A7E.00580303@pok.ibm.com>

I'm afraid that expressions do come with a price in that there
are some ambiguities where you cannot take a shortcut and leave
out specification. Thus if you want the value to include the "("
then you will have to enclose the value in quotes to make the value
a literal.

The working group considered various options, including:

- not permitting expressions for certain properties where it is
  more common to have a literal value rather than an expression
  (extremely difficult to remember which ones permit expressions)
- some special syntax - like starting with a "!" to indicate "don't
  evaluate as an expression"
  (special case saving only one keystroke so not really worth it)
- parsing the value as a string first and then if the value is not
  valid evaluate it as an expression
  (in many cases the first test is ambiguous)
- adding e.g. eval() around all expressions
  (rather cumbersome)

and decided that requiring quotes in some cases was the best trade-off.

>Dear xsl-editors,
>
>The XSL WD 2000-03-27 says:
>
>    5.8 Expressions
>    All property value specifications in attributes within an
>    XSL stylesheet can be expressions.
>
>How to distinguish expressions from immediate (non-expression) values?
>
>The expressions and the immediate values are syntactically different,
>but there are ambiguous points.
>
>In the expression syntax, the string values are quoted with single
>or double-quotes.  e.g., the "format" property may be specified:
>format="'(1)'"  (the outer "" are XML attribute syntax's and inner ''
>are XSL expression syntax's).
>
>We can also specify: format="(1)" as immediate value ("" are XML
>syntax's, not XSL expression's).  Here, the parentheses are part
>of string value (number-formatting: (1) (2) (3) ...),
>but if this is expression, the parentheses are syntax's
>parentheses and the value is 1 (number-formatting: 1 2 3 ...)
>It's very ambiguous.  How to resolve it?
>
>Thanks,
>MURAKAMI Shinyu
Received on Tuesday, 3 July 2001 12:03:16 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 7 December 2009 10:59:52 GMT