JSON serialization of sequences of elements
The existing json:serialize function only allows passing in a single element(). It would be convenient to also pass in a sequence of elements and have them serialized as an Array.
Yea, this library was never intended to return an array but could easily be modified to do so, as suggested.
That said, the json.xqy library in commons is quickly being replaced by the MLJSON project (https://github.com/marklogic/mljson). MLJSON is much more flexible in it's ability to construct JSON strings by including support for creating arrays, objects, a javascript NULL, etc. So I'm much more tempted to add this functionality into that library to encourage folks to switch. Thoughts?
I couldn’t get MLJSON to work, but I didn’t debug very thoroughly. I’ll try again and let you know.
Were you trying to use MLJSON to transform arbitrary XML into JSON? If so, it doesn't do that :).