This has to do with whether or not we require textStandardDecimalSeparator when
textNumberCheckPolicy="strict" and textNumberPattern contains a decimal.
When textNumberCheckPolicy="strict" and textNumberPattern contains a decimal,
then the data *must* contain a textStandardDecimalSeparator.
The negation holds too--if textNumberCheckPolicy="strict" and textNumberPattern
*does not* contain a decimal, then the data *must not* contain a
textStandardDecimalSeparator.
Your schema sets the policy to "strict" and the pattern contains a decimal, so
the data must contain a decimal separator, which means "1" will not successfully
parse but "1.0" will.
In order to parse "1" you need to remove the decimal from you textNumberPattern.
Note that this will mean that "1.0" will no longer parse. If you need both "1"
and "1.0" to parse, then you have to set textNumberCheckPolicy="lax", which
makes it so a decimal separator in the data is be optional regardless of
textNumberPattern.
On 2025-05-07 10:51 AM, Jeremy Yao wrote:
Hi,
In the attached DFDL file, I’m running into the following error, Parse Error:
Unable to parse xs:integer from text: 3, when trying to parse an xs:integer
element from 3_int.txt. If I change 3 to 3.0, like in 3_decimal.txt, parsing works.
I believe the issue may stem from the default dfdl settings in dfdl:format, but
I’m unable to pin-point what combinations of attributes and values are causing
this. Any insight into what’s causing this?
**
*Jeremy Yao | Software Engineer*
*Email:*jeremy....@nteligen.com <mailto:jeremy....@nteligen.com>
*Website:*www.nteligen.com <https://api.mobilocard.com/email/
SMV8Bq4Q3vdLlqncgwhEMwW1vf92/www.nteligen.com>**
/CONFIDENTIALITY NOTICE: This message and any accompanying documents contain
information belonging to the sender which may be confidential and legally
privileged. This information is only for the use of the individual or entity to
which it was intended. If you are not the intended recipient, any disclosure,
copying, distribution, or action taken in reliance on the contents of the
information contained in this message and any accompanying documents is strictly
prohibited. If you have received this message in error, please contact the
sender immediately and delete the message. Thank you./