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

p:xquery and "application/xquery" #184

Closed
xml-project opened this issue Aug 2, 2019 · 5 comments

Comments

@xml-project
Copy link
Contributor

commented Aug 2, 2019

Related to #183 : XQuery defines media type "application/xquery", but this is not accepted by p:xquery which only takes "application/xml /+xml text/*" for port query.
I think we should fix this by making documents with "application/xquery" text documents.

@gimsieke

This comment has been minimized.

Copy link
Contributor

commented Aug 2, 2019

Yes, I think we should

In the same vein, shouldn’t we then also consider application/javascript as text, too? There might be Javascript-executing steps in the future.

The following should go into an issue of its own: Shouldn’t we include application/json in text, too? So that every text-processing step like p:string-replace (which doesn’t accept text or json yet but really should at least accept text) or p:text-join may be used to process JSON documents as text documents?

If a step accepts both json and text, there need to be precedence rules, such as: If a step treats JSON input differently than text input and if the input arrives as application/json, treat it as JSON and not as text.

@ndw

This comment has been minimized.

Copy link
Collaborator

commented Aug 5, 2019

I'm fine with making "application/xquery" documents into text. And "application/javascript" (I already have a cx:javascript step :-) )

However, "application/json" documents aren't text. They're maps or arrays or simple atomic types.

@gimsieke

This comment has been minimized.

Copy link
Contributor

commented Aug 5, 2019

Right. If I want to apply raw text manipulation to a JSON file/document, I can override the content type to text/plain when loading the file, or serialize the structure using the JSON method.

@xml-project xml-project self-assigned this Aug 5, 2019

@xml-project

This comment has been minimized.

Copy link
Contributor Author

commented Aug 5, 2019

Addressed with specification pr 858

@xml-project

This comment has been minimized.

Copy link
Contributor Author

commented Aug 5, 2019

Fixed with specification pr 858

@xml-project xml-project closed this Aug 5, 2019

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