3 ms·
+ at the root would indicate an abstract syntax tree rather than a concrete or "full" syntax tree (terminology varies slightly) This was primarily a mechanism
by nly 5y ago
+ at the root would indicate an abstract syntax tree rather than a concrete or "full" syntax tree (terminology varies slightly)
This was primarily a mechanism to load parsed documents in to code that didn't have access to the recursive descent parser that parsed the document, for either security or performance reasons.
Loading the XML with the appropriate parse flags, doing a pre-order traversal on all the leaf PCDATA, and then printing it out, would regenerate the original document byte for byte.
Perhaps I should go back and implement JSON output and see how I feel about it... thought I'm pretty sure once you introduce a bunch of "text" and "type" fields to the JSON tree it's going to look a lot less readable than XML markup.
There are other fields as well like line and column numbers (output as XML attributes)