Is there a SaxParser that reads json and fires events so it looks like xml

后端 未结 3 927
花落未央
花落未央 2020-12-09 16:23

This would be great as it would allow my xml stuff to read json w/out any change except for the different sax parser.

3条回答
  •  天命终不由人
    2020-12-09 17:27

    I have developed a streaming StAX-based converter: https://github.com/AtomGraph/JSON2XML

    It reads any JSON data and produces XML Representation of JSON specified in XSLT 3.0.

    JSON2XML enables JSON transformation with XSLT even without having an XSLT 3.0 processor. You can simply pre-process the data by having JSON2XML before the transformation, and pipeline it into an XSLT 2.0 stylesheet, for example. That way your stylesheet stays forward compatible with XSLT 3.0, as the XML representation is exactly the same.

    Feedback and pull requests are welcome.

提交回复
热议问题