Skip to content

Adding xsi:nil support to JsonXMLConfigBuilder#27

Open
iuj wants to merge 3 commits intobeckchr:masterfrom
iuj:xml-nil-support
Open

Adding xsi:nil support to JsonXMLConfigBuilder#27
iuj wants to merge 3 commits intobeckchr:masterfrom
iuj:xml-nil-support

Conversation

@iuj
Copy link

@iuj iuj commented Apr 2, 2015

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>

@beckchr
Copy link
Owner

beckchr commented Apr 2, 2015

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!

@iuj
Copy link
Author

iuj commented Apr 2, 2015

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 notifications@github.com
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
#27 (comment).

Ishan Jayawardena
Senior Software Engineer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants