Daniel,
Daniel Carrera wrote:
> Hello,
>
> I just stumbled upon what I think is a minor error in the ODF RelaxNG.
>
> File:
> http://www.oasis-open.org/committees/download.php/12571/OpenDocument-schema-v1.0-os.rng
>
> On lines 3838 and 3843 we have regular expressions with the pattern $?
> which, AFAIK, is not a valid RE. Indeed, those $?'s cause an error when
> you try to convert the spec to compact RelaxNG with trang.
>
> These REs define the data contained in a spreadsheet cell (e.g.
> $Sheet1.[B$4]), that's why there are $?'s in the RE.
>
> I propose that we prefix the $ by a \ character in all instances.
>
> Line 3838:
> Remove: ($?([^\. ']+|'[^']+'))?\.$?[A-Z]+$?[0-9]+
> Add: (\$?([^\. ']+|'[^']+'))?\.\$?[A-Z]+\$?[0-9]+
>
> Line 3843:
> Remove: ($?([^\. ']+|'[^']+'))?\.$?[A-Z]+$?[0-9]+(:($?([^\.
> ']+|'[^']+'))?\.$?[A-Z]+$?[0-9]+)?
> Add: (\$?([^\. ']+|'[^']+'))?\.\$?[A-Z]+\$?[0-9]+(:(\$?([^\.
> ']+|'[^']+'))?\.\$?[A-Z]+\$?[0-9]+)?
In my opinion, the current schema is correct, and it would be wrong to esacpe
the '$' characters.
Regular expressions are defined in appendix F of the XSD specification:
http://www.w3.org/TR/xmlschema-2/#regexs
Rule [9] defines characters and meta characters. The "$" here is not in the
meta characters, but a normal character. It is further not included in the
single char escapes define in rule [24]. So, rule [9] allows us to use the
"$" without escpaing it, and rule [24] actually forbids us to do so.
However, many validators in fact have problems with the fact that "$" is a
normal character. My assumption is that they reuse regular expression
implementations which are not tailored to XSD, and therefore treat "$" as a
meta character. These are bugs in the validators that we cannot work-around
in the schema.
Michael