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

Do we need to say more on p:with-input/@select #832

Closed
xml-project opened this issue Jul 8, 2019 · 9 comments

Comments

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

commented Jul 8, 2019

In p:with-input for attribute "select" we say in the last paragraph:

If a document constructed by selection consists exclusively of text nodes, then it has a content type of text/plain, otherwise it has a content type of application/xml. If the selection result is a map or an array, it is a JSON document. It is a dynamic error (err:XD0016) if the select expression on a p:input or p:with-input returns attribute nodes or function items.

Atomic values are not mentioned here. One can imply that a text document is created from the rest, but I am wondering whether we should say this explicitly.

@Conal-Tuohy

This comment has been minimized.

Copy link

commented Jul 8, 2019

I think the part

If the selection result is a map or an array ...

should instead say

If the selection result is a map, an array, or an atomic value ...

@xml-project

This comment has been minimized.

Copy link
Contributor Author

commented Jul 8, 2019

Yes, may be. But we decided otherwise. My question is purely editorial whether the specs are clear enough in this point.

@Conal-Tuohy

This comment has been minimized.

Copy link

commented Jul 8, 2019

I would say the spec as it stands is not sufficiently clear. If the selection is a sequence of atomic values then it's not at all clear (to me, at least) what kind of document I should expect.

@xml-project

This comment has been minimized.

Copy link
Contributor Author

commented Jul 8, 2019

Thanks. Will try to improve this.

@xml-project xml-project self-assigned this Jul 8, 2019

@ndw

This comment has been minimized.

Copy link
Contributor

commented Jul 11, 2019

If maps and arrays produce JSON documents, I think the consistent result for atomic values is also JSON documents. How is a result of type xs:integer different from a result of type map(*)? We've already agreed that integers, floats, booleans, etc. are all valid JSON documents.

@xml-project

This comment has been minimized.

Copy link
Contributor Author

commented Jul 11, 2019

If I remember right we wanted xs:string (as result of function calls on selected text nodes) and text nodes to be aligned: Both should be text documents here.
This was the reason we decided that all atomic values become text documents.
I have a reservation about treating xs:string different from the other atomic types. But I wouldn't object to make all atomic results JSON documents here.

@ndw

This comment has been minimized.

Copy link
Contributor

commented Jul 11, 2019

Yes, I initially wrote "agreed that are integers, floats, strings, etc." but then I realized we already say that strings become text documents. :-)

@ndw

This comment has been minimized.

Copy link
Contributor

commented Jul 11, 2019

Consensus: atomic values (including string) are passed along as atomic values as "JSON documents"

@xml-project

This comment has been minimized.

Copy link
Contributor Author

commented Jul 11, 2019

Fixed with pr #837

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.