[due diligence] std.xml

Michael Rynn michaelrynn at optusnet.com.au
Tue Oct 26 05:42:35 PDT 2010


On Tue, 19 Oct 2010 21:53:56 +0200, Jacob Carlborg wrote:

> On 2010-10-19 21:37, Andrei Alexandrescu wrote:
>> More detail about the design please? I browsed through the code and the
>> main issue seems to be heavy reliance on granular delegates to do
>> pretty much anything. Would fixing that improve usability? (It would
>> most likely improve performance.)
>>
>> Andrei
> 
> It has a kind of annoying API:
> 
> * Attributes are handled as an associative array instead of classes like
> the rest of the nodes
> * You cannot create an empty Document, you must either create one from
> existing XML data or create one with a root element * There is no way
> the access the parent of a node * No XPath
> 

There is a xml parser and document structure that follows DOM 2-3 interfaces on DSource.
dsource.org/projects/xmlp.

It uses InputRanges to manage the parsing (sort of layered).
Handles DTD .
Has DOM level 2/3 interfaces  (Really, so much of this XML DOM interface
seems directly taken off the Java design).
DOMString type can be aliased as string or wstring.


Handles a lot of XML corner cases, and validates against XML test suite.

Can read multiple source files in different encodings and external DTDs.

The first version also handled namespaces, but I haven't
checked / updated namespaces in the current version, because no-one seems interested,
and so I drifted off and did other things.

The resulting parser and code seems too big and messy for Phobos.

I imagine people just want something that reads in already validated xml,
quick and dirty.


I can imagine no one would have the patience to know where to start using
this , although there are some example test and validation programs.

Theres also a short xpath runtime analyser based on it, 
and a make tool  using this, XML config files and variables, to build D programs, and run commands.

--- 
Michael.



More information about the Digitalmars-d mailing list