Open helmersl opened 5 years ago
@helmersl What would you like the output to be? Based on that, I can suggest if an alternate convention might help.
However, we may have a bigger problem. The XML <AbstractText>head<sub>text</sub>tail</AbstractText>
has the following parts:
tree.tag == 'AbstractText'
tree.text == 'head'
tree.getchildren()[0].tag == 'sub'
tree.getchildren()[0].text == 'text'
tree.getchildren()[0].tail == 'tail'
The last bit -- the "tail" -- is not converted to JSON in any of the conventions I know of. If we need to preserve that, we'll need to research a bit.
But for now, what would you like the output to be? Let's use that as a starting point, perhaps?
My use case is very similar. Probably the most desired result would be to add a special json key (like '$') for the tail.
For my use case, I want to be able to recover the XML in its original form (for example, using the badgerfish.etree method).
I have the same problem. Maybe a list alternating text and objects could provide a good solution
text: ['this is a',{b: 'nice'},'project']
Hi,
I'm using xml2json to parse publications and have the following problem:
If the text in the abstract node contains XML-tags, the text following these seub-nodes is just ignored in the JSON output, so the xml-example:
is converted to JSON as:
Due to the sub-tags.
Is there a way to fix this problem?
Thanks! Lea