Re: Definition of numbers in the MathML RelaxNG

On 19/12/2012 12:27, Frédéric WANG wrote:
> Hi Math WG,
>
> I notice that in the regular expression for "length" and
> "mpadded-length", you use the following definition of numbers:
>
> [0-9]*(\.[0-9]*)?
>
> which allows empty string as numbers and whitespace-only "length".
> I'm wondering if you could replace this regular expression by:
>
> [0-9]*(\.[0-9]*|[0-9])
>
> That will make the schema a bit stricter and help me for a tool I'm
> developing.
>

Stephen pointed out off list that this would still allow a single "."
with no digit and suggested

[0-9]*([0-9]\.?|\.[0-9])[0-9]*

I have finally got round to updating this so the draft spec at

http://www.w3.org/Math/draft-spec/appendixa-d.html#parsing_length

and

http://www.w3.org/Math/draft-spec/appendixa-d.html#parsing_mpadded-length

shows this change.

The RelaxNG and XSD schemas are also updated at

http://www.w3.org/Math/RelaxNG/

and

http://www.w3.org/Math/XMLSchema/


These changes mean that the file

<math xmlns="http://www.w3.org/1998/Math/MathML" >
<mo lspace=".pt"/>
<mo lspace="pt"/>
<mpadded width=".pt"><mo>+</mo></mpadded>
<mpadded width="pt"><mo>+</mo></mpadded>
</math>

which was previously reported as valid is now reported as invalid, which
matches the prose description of the syntax of these attributes given in
the spec.

David

Received on Saturday, 9 March 2013 16:47:46 UTC