Skip to content
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

More clear messages when validating integer values #268

Open
raducoravu opened this issue Sep 19, 2022 · 1 comment
Open

More clear messages when validating integer values #268

raducoravu opened this issue Sep 19, 2022 · 1 comment

Comments

@raducoravu
Copy link

Started based on a discussion on the Oxygen XML Users List which contains more details: https://www.oxygenxml.com/pipermail/oxygen-user/2022-September/006869.html

You have this XML:

<?xml-model href="n.rnc" type="application/relax-ng-compact-syntax"?>
<stuff>1.0</stuff>

and this RNC file:

start = stuff
stuff = element stuff { xsd:integer {minInclusive = "1" maxInclusive = "1"}
}

The validation message for this case states:

      character content of element "stuff" invalid; must be a decimal number without any significant digits after the decimal point

but there are no significant digits after the decimal point.

@djbpitt
Copy link

djbpitt commented Sep 19, 2022

The issue with values like "1.0" and "1." is the decimal point, and not the digits after it. The error message for "1." says that an integer is required, but because the error message does not say anything about value space vs lexical space, a user might not understand that it is the lexical expression (specifically, the decimal point) that raises the error here.

In both cases a more helpful error message might be that xsd:integer values cannot include a decimal point.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants