[uf-dev] JSON serialization of microformats

Michael MD mdagn at spraci.com
Thu Oct 4 19:05:09 PDT 2007


>
> For instance, currently Optimus (Dmitry, this is no knock against you
> or the product), will intelligently substitute values for arrays if
> there is more than one value detected. For instance, hcard: {} will
> become hcard: [ {}, ... ] if there is more than one hcard. While this
> is indeed clever, it requires branching for the reader of the
> resulting JSON, albeit a very easy one.
>
> It seems that if the value can be plural, it should be always wrapped
> into an array. But ultimately, both Mike and I feel that this should
> be agreed upon and documented on the wiki to let developers of JSON
> producers and consumers be on the same page. I'd be happy to get the
> process started, documenting existing behavior based on test cases and
> Optimus output, provided we have consensus on utility of the endeavor.
>


not just JSON....

The little perl liberal parser I made here  (work in progress ... still some 
bugs to fix) puts its output into a perl hash - with any element where there 
can be multiple values represented by an array. (that should be reflected in 
any conversion to JSON too).

I don't really see the need to substitute ..
the first one found could be in [0] regardless...

I'd like to see a bit of discussion about such output  from parsers 
generally with the aim of
working out something that where it is as easy as possible to get at data 
for simple applications
while still maintaining some clues to its hierarchy for more complex apps. 
(even if it means some data might need to be duplicated)

any ideas?







More information about the microformats-dev mailing list