Status of std.xml (D2/Phobos)

Steven Schveighoffer schveiguy at yahoo.com
Mon Jun 28 05:04:35 PDT 2010


On Sun, 27 Jun 2010 14:56:21 -0400, Yao G. <nospamyao at gmail.com> wrote:

> I did a simple implementation of a pull parser, using this API as  
> reference: http://xmlpull.org/
>
> But I used a iterator similar to the one used by Steve (from  
> dcollections) to parse the doc. It turns out that Tango did something  
> similar first (using iterator to parse the document), and seeing the  
> debacle caused by the Date module, I think it would be a bad idea to  
> release it.

Did you look at Tango's code in question, or look at their documentation?   
If not, then you are fine.

I think any implementation is going to have to at least try to use ranges  
or show why they are not a good idea for xml, since Andrei is set on using  
ranges for everything.

BTW, I've not used std.xml or tango's xml, but I agree that an xml library  
is a very important part of today's standard libraries.  Having xml in the  
standard allows for so much usage of it in many other places  
(serialization comes to mind immediately).  If std.xml is bad (which I've  
heard from several independent people), then throw it out and make  
something new.

I myself have tried to think of how xml can be done with ranges, but I  
believe one of the key elements is it has to parse xml without loading the  
entire document to be efficient enough for some applications.  A DOM style  
parser which presents a range interface is probably fine, but a lazy  
interface would be the best.  Since XML is a tree style, you need a range  
which allows moving down the tree.  You almost need a stacking range which  
can move down the tree and also to the next sibling element.  Ideally, the  
library should do as much as possible without allocating anything but  
buffer space to read data.

-Steve


More information about the Digitalmars-d mailing list