[uf-dev] XOXO -> JSON
Dimitri Glazkov
dimitri.glazkov at gmail.com
Wed Aug 8 12:03:09 PDT 2007
Following up on an earlier discussion: http://tinyurl.com/34de9r ...
Suppose, I have this bit of XOXO: http://tinyurl.com/2rygz6
Running this through Kevin's parser produces this:
http://tinyurl.com/39h3v7, which doesn't seem right. One obvious thing
is that the parser does not account for first text node as the "text"
property value, and then the property bag of the second item is
presented as an object, separate from its children.
One possibility is to treat the property bag and the list of children
of a XOXO node as two items of an array:
[ [ { p1: "v1", p2: "v2" }, [ [ /* nested item */ { url:
"http://tinyurl.com/39h3v7" } ] ]
This approach would result in conversion of XOXO mentioned earler to:
http://tinyurl.com/37umpf
Still, the ordered/unordered information is lost. Should it be a
dictionary, instead?:
{ data: { p1: "v1", p2: "v2" }, ol: [ { url: "http://tinyurl.com/39h3v7" } ] }
Any feedback, ideas, alternatives are appreciated.
:DG<
More information about the microformats-dev
mailing list