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

Define whether parameters in abstract patterns are expanded in messages also #10

Closed
xatapult opened this issue Jun 10, 2021 · 6 comments
Labels
2025 A change made in preparing the 2025 edition abstract constructs Issues relating to abstract (patterns, rules) clarification Discusses and clarifies ambiguities element pattern Issues relating to element pattern

Comments

@xatapult
Copy link
Collaborator

It is unclear whether parameters in abstract patterns should be expanded in message texts also. ISO does it, SchXslt (I tested version 1.7.2) doesn't.

@dmj dmj added the clarification Discusses and clarifies ambiguities label Aug 30, 2021
@dmj
Copy link
Member

dmj commented Aug 30, 2021

My interpretation of the specs is that abstract pattern parameters are meant to be substituted in query language expressions only.

This is consistent with the following parts of the 2020 specification:

  • The definition of the param element defines the @value attribute to contain "a fragment of a query" (5.4.9).
  • A query language binding may optionally provide "a lexical convention such as a delimiter by which the parameters of abstract patterns inside query expressions shall be recognised" (6.4).
  • The informative section about the minimal syntax in the 2020 specification describes the process of instantiation as "replacing
    parameter references with actual parameter values in all enclosed attributes that contain queries" (6.2).

I would also argue that replacing abstract pattern parameters inside the natural language assertion message is at odds with diagnostics in general and localized messages in particular.

@rjelliffe
Copy link
Member

rjelliffe commented Aug 31, 2021 via email

@rjelliffe
Copy link
Member

rjelliffe commented Aug 31, 2021 via email

@dmj
Copy link
Member

dmj commented Aug 31, 2021

I think there are two issues:

  1. Should abstract pattern parameters expand in queries of properties and diagnostics?
  2. Should abstract pattern parameters expand in texts (and non-query attributes)?

Re 1: @rjelliffe, you made a compelling argument to do so. We should clarify that. A good place to start would be the (informal) description of pattern instantiation.

Re 2: This would be an enhancement of the pattern templating mechanism.

@AndrewSales AndrewSales added element pattern Issues relating to element pattern abstract constructs Issues relating to abstract (patterns, rules) labels Jun 19, 2023
@AndrewSales
Copy link
Collaborator

AndrewSales commented Mar 11, 2024

My interpretation of the specs is that abstract pattern parameters are meant to be substituted in query language expressions only. [...]
I would also argue that replacing abstract pattern parameters inside the natural language assertion message is at odds with diagnostics in general and localized messages in particular.

I agree with this view.

Should abstract pattern parameters expand in texts (and non-query attributes)? [...] This would be an enhancement of the pattern templating mechanism.

To keep things simple, clear and consistent, I would say the existing provision of value-of is enough.

A concise and effective change here might be to add a note to the definition of the term variable (3.23), e.g.

"Variables are represented in schemas by elements let and param."

The desired clarification then ripples through to value-of and also for property and diagnostic (by dint of the change made for #13).

This would also address #19.

@rjelliffe
Copy link
Member

rjelliffe commented Mar 12, 2024 via email

@AndrewSales AndrewSales added the 2025 A change made in preparing the 2025 edition label Mar 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2025 A change made in preparing the 2025 edition abstract constructs Issues relating to abstract (patterns, rules) clarification Discusses and clarifies ambiguities element pattern Issues relating to element pattern
Projects
None yet
Development

No branches or pull requests

4 participants