beckchr / staxon

JSON via StAX
107 stars 47 forks source link

Support for XML mixed content #22

Closed jlevy closed 10 years ago

jlevy commented 10 years ago

Currently, it appears Staxon does not support mapping XML mixed content such as

<foo>blah blah<bar>blah</bar>blah</foo>

to JSON. Is this right, and are there any plans to support it?

While often XML does not have mixed content, I've definitely seen cases where this is common (e.g. dictionaryapi.com). One approach is here: https://github.com/bramstein/xsltjson

Many thanks for a super useful library!

beckchr commented 10 years ago

Correct, StAXON does not support mixed content. I think the idea to map mixed content to a JSON array would be the way to go. However, mixed content is more of an XML/markup feature and doesn't fit well into JSON's model. StAXON is meant to be a JSON library, not an XML conversion tool. To answer your question, I don't see this feature going into the library any time soon.