NOTE: The current preferred location for bug reports is the GitHub issue tracker.
Bug 745 - [MathML] fix mml.namedspace.datatype to allow rational numbers (not just integers)
[MathML] fix mml.namedspace.datatype to allow rational numbers (not just inte...
Status: RESOLVED FIXED
Product: Validator.nu
Classification: Unclassified
Component: MathML 2.0 schema
HEAD
All All
: P2 normal
Assigned To: Michael[tm] Smith
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2010-05-21 06:26 CEST by Michael[tm] Smith
Modified: 2010-05-21 09:02 CEST (History)
0 users

See Also:


Attachments
patch (955 bytes, patch)
2010-05-21 09:02 CEST, Michael[tm] Smith
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Michael[tm] Smith 2010-05-21 06:26:06 CEST
The mml.namedspace.datatype pattern definition in the MathML RNC schema currently uses the following regular expression:

  [0-9]+(em|ex|px|in|cm|mm|pt|pc|%)?

The limits it to integer values. But the spec actually permits it to be a "decimal integer or rational number (a string of digits with one decimal point), optionally starting with '-'"

So, we need to change the regular expression to match the spec.
Comment 1 Michael[tm] Smith 2010-05-21 08:25:46 CEST
I found the following regexp in the MathML3 spec:

  http://www.w3.org/TR/MathML3/appendixa.html#parsing_length
   
   pattern = '\s*((-?[0-9]*(\.[0-9]*)?(e[mx]|in|cm|mm|p[xtc]|%)?)|(negative)?((very){0,2}thi(n|ck)|medium)mathspace)\s*'

So I'll just review that a "backport" it with whatever changes (if any) are needed to make it conform to the MathML 2.0 spec.
Comment 2 Michael[tm] Smith 2010-05-21 09:02:17 CEST
Created attachment 160 [details]
patch
Comment 3 Michael[tm] Smith 2010-05-21 09:02:43 CEST
validator r353