Re: Wish-list

Michael Kay <[email protected]> Fri, 11 May 2012 11:56:48 +0100
Newsgroups gmane.comp.java.jdom.general
Message-ID <[email protected]>

On 11/05/2012 11:09, Brad Cox wrote:
> Perhaps?
>
>     <array>
>     <value>23</value>
>     <value/>
>     <value><color>red</color></value> 
>
>     <array/>
>     </array>
>
That's an option. But you appear to be representing "null" in the same 
way as an empty map; and you have chosen to map the JSON key "color" to 
the element name "color", which raises the question how you will map 
JSON keys that are not legal element names.

My point is that these problems can be solved in many different ways, 
which is why there are many different mappings of JSON to XML. I don't 
think there is any reason why JSON should work with only one of these 
mappings; the conversion of JSON to XML and the representation of XML in 
Java are two completely orthogonal decisions that do not need to be 
bundled together.

Michael Kay
Saxonica

>
> On Fri, May 11, 2012 at 3:25 AM, Michael Kay <[email protected] 
> <mailto:[email protected]>> wrote:
>
>     OK, so what will the JDOM model look like if this is the JSON input:
>
>     [ 23, null, {color:red}, [] ]
>
>     Michael Kay
>     Saxonica
>
>

_______________________________________________
To control your jdom-interest membership:
http://www.jdom.org/mailman/options/jdom-interest/[email protected]