Project

Profile

Help

Is there some way to provide an XDM map or a JSON file as the context item to XQuery and/or XSLT from the command line?

Added by Martin Honnen about 7 years ago

With maps and arrays being part of the data model I wonder whether it is possible to provide them as the context item when doing XQuery or XSLT from the command line. It seems the @-s@ option is meant to provide an XML document only. Is there any way currently or planned for 9.8 to allow a map or a JSON file as the context item, like @collection()@ already seems to allow JSON mapped to XDM maps/arrays?


Replies (1)

RE: Is there some way to provide an XDM map or a JSON file as the context item to XQuery and/or XSLT from the command line? - Added by Michael Kay about 7 years ago

You can of course provide a URI as a parameter and then do parse-json($param) within the stylesheet.

I'm a bit torn on this one. The combination of options available on the command line is becoming very unmanageable, and I really want to avoid it become even more complex if I can. For example, I've resisted trying to separate the global context item and the initial match selection because I think that would just be very hard to explain to people.

    (1-1/1)

    Please register to reply