Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
Further clarification on XDM step results might be necessary #822
In section "Creating documents from XDM step results" we say:
I think for atomic values it is vague what we mean by 'JSON document' : Do we convert the atomic values as stated in for JSON serialization or do we take the actual XDM value.
To be more concrete: Suppose an p:xslt/p:xquery returns an instance of xs:date. If we use the JSON rules in XProc an JSON document would appear containing a string representation of the xs:date. Or will the JSON document actually contain an xs:date (which is not a JSON type)?
I agree some more clarity would be good, because there is the potential for people to be confused by the rather loose use of the term "JSON document" there.
For the record my understanding of the consensus is that these so-called "JSON documents" may have data types and structures which cannot be represented in JSON documents in the strict sense. So "JSON document" is merely a label for such a data structure, which, if it were to be serialized as JSON, might end up looking quite different.
For instance, the
Maybe it would be better to name these documents something other than "JSON"? More accurately they are general XDM sequences, but that's a mouthful.
I think it would help to reinforce the distinction between these "JSON Documents" in XProc's data model and the JSON data model itself, by explicitly mentioning that XProc "JSON documents" can include XDM instances which contain sequences with cardinality > 1 (in particular, the proposed
Perhaps the word I'm looking for here is "well-formed". XProc JSON Documents are not guaranteed to be well-formed JSON.