Replacing std.xml

Michel Fortin michel.fortin at michelf.ca
Mon Sep 2 06:52:18 PDT 2013


On 2013-09-02 13:34:18 +0000, "qznc" <qznc at web.de> said:

> On Saturday, 31 August 2013 at 18:53:42 UTC, Michel Fortin wrote:
>> For instance, Tango's SaxParser is based on its PullParser. This design 
>> requires the use a dynamic array to maintain a stack of opened 
>> elements. While not a huge performance hit, you don't need that if you 
>> use recursion, which you can do with my implementation. You can do that 
>> even though you can also use it as a pull tokenizer[^1] when needed 
>> (recursion is optional on a token-by-token basis).
> 
> Recursion means you use the call stack instead of stack object on the heap.
> 
> Be careful about nesting deepness. There are XML documents out there 
> with thousands and more nested elements. With recursion on a 32bit 
> machine you might get a stack overflow, but a heap-stack could handle a 
> million nested elements.

Good point about caring for pathological cases.

-- 
Michel Fortin
michel.fortin at michelf.ca
http://michelf.ca



More information about the Digitalmars-d mailing list