Feature #3676
closed![Author: Debbie Lockett](https://www.gravatar.com/avatar/9c2ec304a5bec55af709863d87d5f6b7?rating=PG&size=50&default=https%3A%2F%2Fassets.plan.io%2Fimages%2Fdefault_avatar.png)
![Assignee: Debbie Lockett](https://www.gravatar.com/avatar/9c2ec304a5bec55af709863d87d5f6b7?rating=PG&size=22&default=https%3A%2F%2Fassets.plan.io%2Fimages%2Fdefault_avatar.png)
Implement serialization to JSON
100%
Description
The Saxon-JS implementation of fn:serialize() is non-conformant (see https://www.saxonica.com/saxon-js/documentation/index.html#!conformance/xslt30 and https://saxonica.plan.io/boards/5/topics/6696). It's generally on our "todo" list to improve the implementation.
One place we should perhaps start is with serializing to JSON. This could be important to provide a decent mechanism for converting XDM maps to JSON objects. This especially becomes relevant following the changes in the way we convert between XDM maps and JavaScript objects (see https://saxonica.plan.io/issues/3545).
The suggested mechanisms for conversion from a JSON object to a XDM map, and back, are then:
-
JS to XDM: JSON.stringify() in JavaScript, then parse-json() in XSLT
-
XDM to JS: serialize() to JSON in XSLT, then JSON.parse() in JavaScript
Please register to edit this issue
Also available in: Atom PDF Tracking page