Adding xsi:nil support to JsonXMLConfigBuilder
1.Adds support to process xsi:nil (defined in http://www.w3.org/TR/xmlschema-1/#xsi_nil) to be produced as a null value in XML->JSON transformation.
Example: If readXmlNil(true) is set,
<test xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true" ></test> will produce {"test":null}
<test></test> will produce {"test":""}
2.Adds support to process null fields as xsi:nil elements during JSON->XML transformation.
Example: if writeXmlNil(true) is set,
{"test":null} will produce <test xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true" ></test>
{"test":""} will produce <test></test>
Hi,
thanks for your contribution!
From a first quick look I"m asking myself why JsonXMLStreamReader uses writeXmlNil and JsonXMLStreamWriter uses readXmlNil. I would have expected it the other way round...
Anyway, I will have to investigate this a little further, I think. For now, thanks!
I agree.. :) We can modify the method names. imagine writeXmlNil as 'readJsonNullToWriteAsXmlNil' and readXmlNil as 'writeJsonNullFromPreviouslyReadXmlNil'
On Thu, Apr 2, 2015 at 3:35 PM, Christoph Beck [email protected] wrote:
Hi,
thanks for your contribution!
From a first quick look I"m asking myself why JsonXMLStreamReader uses writeXmlNil and JsonXMLStreamWriter uses readXmlNil. I would have expected it the other way round...
Anyway, I will investigate this al little further, I think. For now, thanks!
Reply to this email directly or view it on GitHub https://github.com/beckchr/staxon/pull/27#issuecomment-88855483.
Ishan Jayawardena Senior Software Engineer