<div dir="ltr">Yep, I was recently looking into this because I'm writing a library that will provide XPath like querying for JSON. The only thing RFC 4627 (JSON) says is: "<span style="color:rgb(51,51,51);font-family:'Helvetica Neue',Arial,sans-serif;font-size:14px;line-height:18px">"The names within an object SHOULD be unique." But this is "should" in the sense of </span><span style="color:rgb(51,51,51);font-family:'Helvetica Neue',Arial,sans-serif;font-size:14px;line-height:18px;background-color:rgb(245,245,245)">RFC 2119, i.e. it means "recommended".</span><span style="background-color:rgb(245,245,245)">..</span><div dir="ltr">
<div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jan 22, 2013 at 6:51 AM, Richard O'Keefe <span dir="ltr"><<a href="mailto:ok@cs.otago.ac.nz" target="_blank">ok@cs.otago.ac.nz</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div class="im"><br>
On 19/01/2013, at 2:55 AM, Thomas Lindgren wrote:<br>
<br>
><br>
><br>
> One potential problem with SAX-style parsing is that repeated keys in a JSON object will use/return only the last value (a behaviour inherited from javascript, I believe).<br>
<br>
</div>When implementing a JSON parser, I found the JSON specification<br>
silent about this and asked for clarification.  Taking the last<br>
value for repeated keys is *NOT* a defined property of JSON nor<br>
is it something you can expect as a de-facto standard.  Some<br>
parsers will take the first value.  Some will take the last one.<br>
Some will raise a sensible exception.  Some a non-sensible one.<br>
<div class=""><div class="h5"><br>
<br>
_______________________________________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>
<a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br>My other car is a cdr.
</div></div></div>