-
Notifications
You must be signed in to change notification settings - Fork 73
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add test that illustrates float text parse bug #1132
Conversation
This is a representation="text" xs:float that is delimited. Parsing Float.MaxValue i.e., this text string: ``` 3.4028235E38 ``` I get this error: ``` Parse Error: Value '340282350000000000000000000000000000000' is out of range for type: xs:float ``` No similar issue for type xs:double. DAFFODIL-2867
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 with a question
<tdml:parserTestCase name="float_text_delim" root="floatTextDelim" | ||
model="SimpleTypes-Embedded.dfdl.xsd" description="Section 5 Simple type-float - DFDL-5-008R"> | ||
|
||
<tdml:document><![CDATA[3.4028235E38]]></tdml:document> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The document does not end with the terminator (%SP;) expected by the floatTextDelim type. Can you comment on what the implications are?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fields with lengthKind="delimited"
can be delimited by more than just separators, including EOF. From the spec:
On parsing, the length of an element with dfdl:lengthKind 'delimited' is determined by scanning the data stream for the delimiter.
The data stream is scanned for any of
· the element's terminator (if specified)
· an enclosing construct's separator or terminator
· the end of an enclosing element designated by its known length
· the end of the data stream
So the dfdl:separator="%SP;" isn't really needed in this case, but it doesn't hurt.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
<tdml:parserTestCase name="float_text_delim" root="floatTextDelim" | ||
model="SimpleTypes-Embedded.dfdl.xsd" description="Section 5 Simple type-float - DFDL-5-008R"> | ||
|
||
<tdml:document><![CDATA[3.4028235E38]]></tdml:document> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fields with lengthKind="delimited"
can be delimited by more than just separators, including EOF. From the spec:
On parsing, the length of an element with dfdl:lengthKind 'delimited' is determined by scanning the data stream for the delimiter.
The data stream is scanned for any of
· the element's terminator (if specified)
· an enclosing construct's separator or terminator
· the end of an enclosing element designated by its known length
· the end of the data stream
So the dfdl:separator="%SP;" isn't really needed in this case, but it doesn't hurt.
This is a representation="text" xs:float that is
delimited. Parsing Float.MaxValue i.e., this text string:
I get this error:
No similar issue for type xs:double.
DAFFODIL-2867