beckchr / staxon

JSON via StAX
107 stars 47 forks source link

JsonXMLStreamReader does not allow to set any XML version (nor encoding) #39

Open victornoel opened 7 years ago

victornoel commented 7 years ago

Hi,

Apparently, when using a JsonXMLStreamReader, getVersion() and getCharacterEncodingScheme() always return null.

In some case this can be problematic, for example I got confronted to this bug: https://bugs.openjdk.java.net/browse/JDK-8016914.

It could be great if it was possible for the user to give values to return for these information. For example via a configuration property? I'm not sure how :)

beckchr commented 7 years ago

However, returning null is correct according to the StAX spec because there is no XML declaration.

victornoel commented 7 years ago

Yes I know :)

It's more of a feature request than a bug, I guess it could make sense to decide which version of XML should be outputed from a JSON to XML conversion? Not sure if it is the usual way to do it though…