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

Missing error for Xpath errors #700

Closed
xml-project opened this Issue Jan 8, 2019 · 5 comments

Comments

Projects
None yet
2 participants
@xml-project
Copy link
Contributor

xml-project commented Jan 8, 2019

In XProc 1.0 we had XD0023 saying

It is a dynamic error if an XPath expression is encountered which cannot be evaluated (because it is syntactically incorrect, contains references to unbound variables or unknown functions, or for any other reason).

We kind of lost that error. I would like to see it come back.

@xml-project

This comment has been minimized.

Copy link
Contributor

xml-project commented Jan 8, 2019

Related: Is it really true, that we raise a static error (err:XS0071) for this:

It is a static error if the XPath expression refers to the name of a variable that is not present in the in-scope bindings.

I would argue that should be a dynamic error, only raised, if the XPath expression is actually evaluated.

@ndw

This comment has been minimized.

Copy link
Contributor

ndw commented Jan 8, 2019

shrug

It could be a dynamic error. My intuition is that 99% of the time $fooo is a typo for $foo and it would be better to catch it immediately. It's not a case where it could ever work successfully if that expression is ever evaluated.

@ndw

This comment has been minimized.

Copy link
Contributor

ndw commented Jan 8, 2019

I feel like the question of whether references to functions that are unknown should also be dynamic, but I can't find that now.

Whatever we decide for unknown variables should probably apply to unknown functions.

@xml-project

This comment has been minimized.

Copy link
Contributor

xml-project commented Jan 8, 2019

Currently we have the static error only for missing variables, not for missing functions and not even for syntactically incorrect expressions (missing ')') or something like this.

I agree with you, that we should treat all cases in the same way.

I would definitely be open for having an error equivalent to XD0021 (in XProc 1.0), but make it static.

I am not sure we had this discussion before or if I mix up things.

@xml-project

This comment has been minimized.

Copy link
Contributor

xml-project commented Jan 10, 2019

overtaking by #703

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment