Status of std.xml (D2/Phobos)

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Mon Jun 28 11:27:13 PDT 2010


Michel Fortin wrote:
> On 2010-06-27 07:04:30 -0400, Justin Johansson <no at spam.com> said:
> 
>> May I ask is anybody working on redeveloping std.xml in the D2/Phobos 
>> library?  (Currently it looks like it needs to be started over from 
>> scratch)
>>
>> Also what is the level of interest from library users for decent XML 
>> support in D2/Phobos?
> 
> I have made my own parser, comprised of a tokenizer and a mini DOM layer.
> 
> I'm not sure how to qualify the tokenizer: it's mainly based on 
> callbacks like an event parser, but a callback can decide to stop the 
> parsing process and return to the original caller of the tokenizer 
> (which can later restart parsing), it can choose to continue parsing the 
> next token, or to recursively continue to run the parser using a 
> different set of callbacks. From there it's trivial to efficiently 
> implement a pull parser or a SAX parser, but the way callbacks can 
> recursively call the tokenizer allows greater flexibility than those two 
> models.
> 
> The mini DOM I've made is based on this tokenizer, but is quite ordinary 
> in comparison.
> 
> Here's the generated documentation:
> 
> http://michelf.com/docs/d/mfr/xmltok.html
> http://michelf.com/docs/d/mfr/xml.html
> 
> I'm slowly revamping it to use ranges instead of strings.

I think a tokenizer should be a higher-order range that is fed an input 
range of ubyte, char, wchar, or dchar (so that would be a type 
parameter) and is itself a range of Tokens that include the token type, 
token value etc.

Andrei


More information about the Digitalmars-d mailing list