Closed
Bug 331897
Opened 19 years ago
Closed 19 years ago
support for validating xsd:double schema type
Categories
(Core Graveyard :: XForms, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: aaronr, Assigned: sspeiche)
References
Details
(Keywords: fixed1.8.0.5, fixed1.8.1)
Attachments
(2 files, 3 obsolete files)
1.17 KB,
application/xhtml+xml
|
Details | |
13.63 KB,
patch
|
Details | Diff | Splinter Review |
Be nice if we could validate xsd:double schema type. This actually fails testcase 8.1.7.f in the testsuite.
Assignee | ||
Comment 2•19 years ago
|
||
patch + updated test cases. Verified against attached test case and W3C test suite. JST review complains about a few things that I think it's just confused about the & operand and String arg types.
Attachment #221706 -
Flags: review?(doronr)
Comment 3•19 years ago
|
||
Comment on attachment 221706 [details] [diff] [review] patch Patch looks good, but the spec says for the lexical space: http://www.w3.org/TR/xmlschema-2/#double "The special values positive and negative infinity and not-a-number have lexical representations INF, -INF and NaN, respectively. Lexical representations for zero may take a positive or negative sign." Do we need to worry about those?
Attachment #221706 -
Flags: review?(doronr) → review+
Assignee | ||
Comment 4•19 years ago
|
||
I hesitate to say this is good enough since the one test case fails. Though it is unclear if -INF < INF, I would think so. Let me know if there might be a better way to handle this.
Attachment #221706 -
Attachment is obsolete: true
Attachment #221739 -
Flags: review?(doronr)
Comment 5•19 years ago
|
||
Why is it failing? I am not sure we need to even consider the 3 text values, do other processors support them?
Assignee | ||
Comment 6•19 years ago
|
||
(In reply to comment #5) > Why is it failing? I am not sure we need to even consider the 3 text values, > do other processors support them? > It is failing since strtod doesn't return appropriate values for INF and -INF (actually tested float and ToFloat() has the same problems). strtod usually returns 0.0 for both INF and -INF. ToFloat() usually returns garbage for INF and -INF. X-Smiles uses the Xerces validator, which handles these properly ie -INF < INF, -INF < everything, everything < INF, ... what you'd expect. So I recommend considering support for double done and followup with with a separate INF/-INF bug for str functions (or should we handle it indirectly in our processing of infinity). Note, after saying all of this...I can't possibly think that anyone is using infinity but you never know.
Assignee | ||
Comment 7•19 years ago
|
||
Don't know if you want these committed but thought it might be helpful. Updated to test with INF/-INF
Comment 8•19 years ago
|
||
Comment on attachment 221739 [details] [diff] [review] patch2 - with support for INF/-INF/NaN Yeah, lets go with this and file a bug about INF/-INF.
Attachment #221739 -
Flags: review?(doronr) → review+
Assignee | ||
Updated•19 years ago
|
Attachment #221739 -
Flags: review?(allan)
Assignee | ||
Comment 9•19 years ago
|
||
Comment on attachment 221811 [details] [diff] [review] patch for schema test suite, shows INF edge cases obsoleting, will move to bug regarding INF/-INF
Attachment #221811 -
Attachment is obsolete: true
Comment 10•19 years ago
|
||
Comment on attachment 221739 [details] [diff] [review] patch2 - with support for INF/-INF/NaN Isn't this Doron-land? That said, the code looks sane, except for: >- return (pEnd != aString); >+ // If end pointer hasn't moved, then there was an error Either the code or the comment is wrong then. >+ if (pEnd == aString) { >+ NS_NAMED_LITERAL_CSTRING(temp, aString); >+ >+ // doubles may be INF, -INF or NaN >+ if (!temp.Equals(NS_LITERAL_CSTRING("INF")) && >+ !temp.Equals(NS_LITERAL_CSTRING("-INF")) && >+ !temp.Equals(NS_LITERAL_CSTRING("NaN"))) { >+ isValid = PR_FALSE; >+ } >+ } >+ return isValid; With that fixed, r=me
Attachment #221739 -
Flags: review?(allan) → review+
Assignee | ||
Comment 11•19 years ago
|
||
Doron allowed me to enter Doron-land. Fixed comment, ready for checkin.
Attachment #221739 -
Attachment is obsolete: true
Comment 12•19 years ago
|
||
(In reply to comment #11) > Created an attachment (id=222030) [edit] > patch 3, with comment fixed > > Doron allowed me to enter Doron-land. :) I meant: r=doronr, and be done with it?
Reporter | ||
Comment 13•19 years ago
|
||
checked into trunk for sspeiche
Status: NEW → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
Whiteboard: xf-to-branch
Comment 14•19 years ago
|
||
Doron-land is a happy place with clowns and free baloons.
Updated•19 years ago
|
Keywords: fixed1.8.1
Updated•19 years ago
|
Keywords: fixed1.8.0.5
Updated•19 years ago
|
Whiteboard: xf-to-branch
Updated•8 years ago
|
Product: Core → Core Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•