Closed GoogleCodeExporter closed 8 years ago
The first two problems are caused by the logic getting reversed somehow:
Line 329 should be negated:
if( ! parent.containsKey(jLocalName) )
The latter bug is caused by adding attributes to the wrong record in
startElement();
it should use the originally created record on each loop iteration.
While you're fixing this code, you could also eliminate insignificant text()
fields
(those with only whitespace). The example below produces one. It is the same
as
your example above, but shows how to avoid quoting issues using "here doc"
syntax, as
in perl. You could also use single quotes in jaql and double quotes in xml to
avoid
escaping the quotes (but you'd still have to escape backslashes).
xmlToJson(<<ENDDOC
<?xml version="1.0" encoding="UTF-8"?>
<pre1:book xmlns:pre1="http://www.pre1.com" xmlns:pre2="http://www.pre2.com">
<pre1:chapter pre1:name="Intro" pre2:length="">Programming</pre1:chapter>
</pre1:book>
ENDDOC );
Original comment by dr.be...@gmail.com
on 7 Oct 2009 at 9:48
Fixed in Revision 382. Thanks for the suggestion of "here doc" syntax for
embedding
XML when writing documents.
Original comment by yaojingguo@gmail.com
on 9 Oct 2009 at 1:21
Original issue reported on code.google.com by
yaojingguo@gmail.com
on 25 Sep 2009 at 8:48