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

List-valued options represented as arrays #1659

Closed
GuntherRademacher opened this issue Dec 17, 2024 · 2 comments
Closed

List-valued options represented as arrays #1659

GuntherRademacher opened this issue Dec 17, 2024 · 2 comments
Labels
Bug Something that doesn't work in the current specification Editorial Minor typos, wording clarifications, example fixes, etc. PR Pending A PR has been raised to resolve this issue XQFO An issue related to Functions and Operators

Comments

@GuntherRademacher
Copy link
Contributor

The specification of the of the option parameter conventions contains this:

In cases where an option is list-valued, by convention the function should accept either a sequence or an array: but this rule applies only if the specification of the option explicitly accepts either. Accepting a sequence is convenient if the value is generated programmatically using an XPath expression; while accepting an array allows the options to be held in an external file in JSON format, to be read using a call on the fn:json-doc function.

In particular, it says

...this rule applies only if the specification of the option explicitly accepts either...

However I could not find any option that explicitly makes use of "accepts either" in the specification. In the tests, I found two cases where arrays are passed as option values: numberformat-510 (here the option isn't even list-valued), and serialize-xml-106a.

I am wondering whether the above paragraph might be superfluous. The text preceding it says that option values are coerced to the required type, and that implies converting an array to its member sequence, doesn't it?

@michaelhkay
Copy link
Contributor

the function should accept either a sequence or an array

I thought we had dropped that, but it seems not. Thanks for pointing it out.

@ChristianGruen ChristianGruen added Bug Something that doesn't work in the current specification Editorial Minor typos, wording clarifications, example fixes, etc. XQFO An issue related to Functions and Operators labels Dec 17, 2024
@michaelhkay michaelhkay added the PR Pending A PR has been raised to resolve this issue label Dec 19, 2024
@GuntherRademacher
Copy link
Contributor Author

Fixed by #1664.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something that doesn't work in the current specification Editorial Minor typos, wording clarifications, example fixes, etc. PR Pending A PR has been raised to resolve this issue XQFO An issue related to Functions and Operators
Projects
None yet
Development

No branches or pull requests

3 participants