-
Notifications
You must be signed in to change notification settings - Fork 0
Description
If you create, for example, a p:xquery step that produces a string, that string gets labeled application/json because it's a simple atomic value.
But that means if you subsequently try to use that document where a text document is expected (for example p:ixml or p:text-tail, etc.), you'll get an error.
Requiring the user to insert p:cast-content-type steps in between seems awfully tedious.
My temptation is to suggest that if an application/json document is passed where a text document is expected, and that JSON document is a simple atomic value (as opposed to a map or array), then we automatically cast it to a text document by serializing the atomic value.
But I don't know if that'll have other consequences we won't like...
I suppose an alternative approach would be to say that if a step produces a simple atomic value that's an xs:string or xs:untypedAtomic, we label it text/plain instead of application/json.
Or maybe something else I haven't thought of...