Re: schema for XHTML 1.0

On 15 Sep 2006, at 13:36 , Wolfgang Jeltsch wrote:

> ...
> 	[1]
> 	cannot derive simpleType by restriction: "([-+]?(\d+|\d+(\.\d+)?%) 
> (,\s*[-+]?
> 	(\d+|\d+(\.\d+)?%))*)" invalid value for pattern facet: character  
> "-" must be
> 	escaped with "\" in this context [st-props-correct.1]
>
> 	[2]
> 	cannot derive simpleType by restriction: "([-+]?(\d+|\d+(\.\d+)? 
> %))" invalid
> 	value for pattern facet: character "-" must be escaped with "\" in  
> this
> 	context [st-props-correct.1]
>
> 	[3]
> 	cannot derive simpleType by restriction: "([-+]?(\d+|\d+(\.\d+)?%)| 
> [1-9]
> 	(\d+)?\*)" invalid value for pattern facet: character "-" must be  
> escaped
> 	with "\" in this context [st-props-correct.1]
>
> What's the reason for this?  Is escaping the - characters enough to  
> get a
> correct schema?

As Michael Kay has noted, the first edition of the spec had an error
(ambiguity in the grammar, if I remember correctly), which the Working
Group fixed in an erratum by requiring that hyphens be escaped in
the context shown here.  When the Proposed Edited Recommendation
for XML Schema 1.0 Second Edition was published, there was a
comment arguing that the erratum was unnecessary and badly done,
and proposing a less problematic way to repair the original problem.
On consideration, the Working Group agreed with that comment, and
made another correction.

It is (or should be, if the grammar is now correct) unnecessary to  
escape
the hyphens above.  But it should also be harmless to do so (and to be
honest I thought the HTML Working Group had drawn the obvious
conclusion and put the escapes in, since doing so would mean the
schema had a better chance of working with all processors -- are you
sure you're working with the most recent schema documents for the
XHTML namespace?).

I hope this helps.

--Michael Sperberg-McQueen

Received on Saturday, 16 September 2006 02:07:45 UTC