beckchr / staxon

JSON via StAX
107 stars 47 forks source link

convert empty array #19

Closed mheijink closed 11 years ago

mheijink commented 11 years ago

Hi, I have this xml:

<ns:getWerkplekBeschikbaarheidByLocatieCodeResponse xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="http://xxx//">
  <ns:computerRuimteInformatieLijst/>
</ns:getWerkplekBeschikbaarheidByLocatieCodeResponse>

When I convert it I get:

{
  "getWerkplekBeschikbaarheidByLocatieCodeResponse" : {
    "computerRuimteInformatieLijst" : null
  }
}

But i would like to get nothing when I convert it. Online xml to json convertors work this way. Is it possible ?

Kind regards

beckchr commented 11 years ago

It's there in XML, why should it disappear in JSON? This is the way an empty element is mapped in StAXON. Also, at least not all online converters do it wrong: http://www.freeformatter.com/xml-to-json-converter.html

mheijink commented 11 years ago

Ok, thanks

From: Christoph Beck [mailto:notifications@github.com] Sent: maandag 3 juni 2013 15:58 To: beckchr/staxon Cc: Marcel Heijink Subject: Re: [staxon] convert empty array (#19)

It's there in XML, why should it disappear in JSON? This is the way an empty element is mapped in StAXON. Also, at least not all online converters do it wrong: http://www.freeformatter.com/xml-to-json-converter.html

— Reply to this email directly or view it on GitHubhttps://github.com/beckchr/staxon/issues/19#issuecomment-18842753.