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

Should the ixml spec distinguish between static and dynamic grammar errors? #25

Closed
cmsmcq opened this issue Jan 11, 2022 · 3 comments
Closed
Assignees
Milestone

Comments

@cmsmcq
Copy link
Contributor

cmsmcq commented Jan 11, 2022

The spec can currently be read as defining several distinct kinds of result for the operation of an ixml processor. (This also arises in connection with test suites.)

  • The grammar conforms to the rules, and the input matches the grammar (more formally: is a sentence in the language defined by the grammar). Result: an XML representation of the parse tree.
  • The grammar conforms to the rules, and the input does not match the grammar ("the parse fails"). Result: an XML representation of the failure, with ixml:state="failed" on the root element.
  • The grammar does not conform to the rules.
  • Something else goes wrong (out of memory, ...)

In some cases, the grammar may be syntactically correct (it matches the grammar for grammars) but produce ill-formed output for some inputs: multiple same-named attributes on the same element, non-XML characters in the output, non-XML names on elements or attributes ... The spec is not clear on how to classify these situations, and discussion has made several options clear:

  • It is an error in the grammar. If processors are required to detect all non-conforming grammars (as they currently are), the processor ought to have detected that the grammar was non-conforming.
  • It is an error in the input, not in the grammar.
  • It is a special kind of error in the grammar, which the processor is required to detect only on inputs that reveal the error.

To make this a concrete issue suitable for discussion, perhaps it's best to make a specific proposal: The ixml spec should distinguish two kinds of errors in grammars: errors a processor is required to detect regardless of the input to be parsed, and errors which may remain undetected if the input does not exercise them. The distinction is analogous to that between static and dynamic errors in XSLT and XQuery (and other languages), but it is proposed that we find other terms to distinguish them in the ixml spec.

Should we make such a distinction?

What should the two classes of grammar error be called?

@cmsmcq
Copy link
Contributor Author

cmsmcq commented Feb 22, 2022

On the call of 15 February we agreed in principle to distinguish these two classes of error and to allow processors to detect possible dynamic errors statically.

@cmsmcq
Copy link
Contributor Author

cmsmcq commented Feb 28, 2022

This was discussed further on 22 February 2022.

ACTION (20220222-02): Steven to outline examples in the spec. to differentiate static and dynamic errors (issue #25).

@ndw
Copy link
Contributor

ndw commented May 10, 2022

At the 10 May 2022 CG meeting, Steven asserted this was completed. If it isn't, I propose that a new issue be raised (or reopen this one).

@ndw ndw closed this as completed May 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants