Open jn0 opened 7 years ago
Plus, I'd like to preserve XML comments too.
Say, under !
"property name" (and "serialize" them the same way: !
, !!
, !!!
, etc):
{
"!": "comment 1",
"some": { "more": "JSON here" },
"!!": "comment 2"
}
@jn0 -- on the comments and text fragments (your "z"), the BadgerFIsh convention is silent. There is a bi-directional extension that uses $1
, $2
, etc for text fragments and !1
, !2
, etc for comments -- but this is not backward compatible with BadgerFish.
Also, if we did extend this, I'd like it to also work (to the extent possible) for the other conventions we're implementing -- i.e. GData, Yahoo and Parker.
Any thoughts on how you might structure the JSON attributes for these?
@sanand0 not much actually: I'm a newbie here, in XML land :)
But $2
and !2
look no worse than $$
and !!
(as well as #2
for CDATA).
It looks quite obvious to me that loosing parts of the source isn't good enough anyway.
Maybe, just add , bidirectional=False
to the BadgerFish
constructor and act respectively?
The only point is to grab the parts in traditional dict
into a tuple for the non-bidirectional mode, I think.
This will loose the exact positions, but still preserve values...
Hi @sanand0 !
I have the same problem as @jn0 : some data miss in my json output. I think that there is a problem of recursivity in your parser. Can you have a look on that, please ?
Best, Alexandra
This problem also impacts the Abdera and Cobra conventions I implemented. The problem itself is indicated as a TODO (and commented test) in the tests.
Look at this example:
Output will be:
Where is
z
value?Tested with
The
xmljson
was installed viapip
.I'd expect something like