这会很棒,因为除了不同的 sax 解析器之外,它可以让我的 xml 内容读取 json 而无需任何更改。
最佳答案
如果您的意思是基于事件的解析器,那么有几个项目可以做到这一点:
http://code.google.com/p/json-simple/
Stoppable SAX-like interface for streaming input of JSON text
This project has moved to https://github.com/fangyidong/json-simple
http://jackson.codehaus.org/Tutorial
Jackson Streaming API is similar to Stax API
This project has moved to https://github.com/FasterXML/jackson-core
关于java - 是否有一个 SaxParser 可以读取 json 并触发事件,所以它看起来像 xml,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4373233/