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

String to number conversion: Differences between JavaRosa and Webforms #240

Open
brontolosone opened this issue Oct 14, 2024 · 0 comments
Open

Comments

@brontolosone
Copy link
Contributor

While working on #49, I stumbled upon some implementation differences between webforms and JavaRosa, that came about while thinking about "how and why does JR allow a randomization seed from a node with text, is that intentional or accidental, and should Webforms do the same" (so far I only have answers to #1 and maybe #2). Anyway:

The equivalent of a JS Number as used in Webforms is the Java Double. Same thing, same precision, so in theory this should allow identical outcomes on both platforms.

Evidently the JR implementation is much more extensive; and there's talk about "xpath type conversion rules" — which I haven't looked up, but those sound as if they could be relevant for webforms.

Poignantly, JR allows for "123,123" -> 123.123, while Webforms makes this a NaN.
Conversely, Webforms allows "0x12" -> 18, while JR would make this a NaN.

The question is thus: which one (if any) of the two is right? And if JR is right, what'd be the appropriate site for the Webforms implementation of same?

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

No branches or pull requests

1 participant