Closed xquery closed 9 years ago
The current spec says that steps produce documents, not atomic values. In XProc 2.0, any kind of document, but still a document. If you wrap 5 in a document node:
document-node { text-node { 5 } }
That should work. If your step emits some sort of binary document for JSON, then that should work too.
Atomic values or lists of atomic values, etc. wrapped in an XDM document node seems to be sufficient.
Romain Deltour conveyed this idea to me at XML Prague 2015 conference.
When step processing results in an atomic value (or sequence of atomic values) we may want to consider a heuristic for defining some kind of <c:*> wrapping behaviour which is informed by defined or default content-type of p:output port; which avoids throwing an error. We could consider a top level switch that controls this behaviour on the root p:pipeline|p:declare-step.
Its an open question if we need to identify an equivalent approach for other formats ex. a step emitting json could happily emit an array [{},{} ....].