Re: bad input to system-color()

Max Froumentin wrote at 24 Jul 2002 10:56:51 +0200:
 > Tony Graham <Tony.Graham@Sun.COM> writes:
 > 
 > > Speaking of system-color(), what happens if the NCName is not the
 > > name of a system defined color?
 > 
 > It's up to the WG to provide a final decision on this, but in my opinion
 > the CSS parsing error rules (which basically say "ignore any statement
 > that has a bad syntax [1]") should be extended to system-color()
 > 
 > [1] http://www.w3.org/TR/REC-CSS2/syndata.html#parsing-errors

The significant text from CSS2 is:

   In some cases, user agents must ignore part of an illegal style
   sheet. This specification defines ignore to mean that the user
   agent parses the illegal part (in order to find its beginning and
   end), but otherwise acts as if it had not been there. 

There are currently only a few error recovery actions described in the
XSL Recommendation, and none for invalid property value expressions.

Surely any error recovery mechanism should be applicable to all
property values, since, for example, there are some error conditions
defined for other functions (e.g., from-table-column()), plus it's
possible to goof and make invalid property expressions, e.g.,
font-size="12pt +".

It's also possible to make perverse property value expressions that
obey the letter of the Recommendation but are either unresolvable or
contrary to the intent of the Recommendation.  For example, what is
the value of column-number in:

  <fo:table-cell
     column-number="from-table-column(hyphenation-push-character-count)">

or font-size in:

  <fo:table-column column-width="12pt"
    font-size="proportional-column-width(1)"/>

or column-width in:

  <fo:table-column column-width="proportional-column-width(2) div 2"/>
  <fo:table-column column-width="proportional-column-width(1) * 2"/>

However, it is probably too late to add a general error recovery
mechanism to XSL 1.0 to handle illegal property value expressions,
unless the text said, much like in XSLT 1.0, that the processor can
either abort or recover.

Regards,


Tony Graham
------------------------------------------------------------------------
XML Technology Center - Dublin                mailto:tony.graham@sun.com
Sun Microsystems Ireland Ltd                       Phone: +353 1 8199708
Hamilton House, East Point Business Park, Dublin 3            x(70)19708

Received on Thursday, 1 August 2002 09:06:54 UTC