Phobos Proposal: replace std.xml with kxml.

Graham Fawcett fawcett at
Mon May 3 15:31:16 PDT 2010

On Tue, 04 May 2010 09:18:46 +1200, Bernard Helyer wrote:

> When I first started using D, one of the things I needed quite early on
> was a way of writing and reading XML. Naturally, when I saw std.xml in
> Phobos, I was quite pleased.
> That was of course, until I started to use it.
> I vented my frustation on IRC, where opticron mentioned he had an XML
> library of his own. I find it superior to std.xml, especially
> considering how it actually works, and is maintained.
> It is already under the Boost License, and opticron has said
> "<opticron> ... if they really want to snag mine and clean it up for use
> in phobos, that's fine
> <opticron> I'd even relicense the code if I have to"
> I'm going to keep on using kxml regardless, but I thought it would be
> nice if Phobos had a working XML library. What say you?

I haven't looked at kxml -- but why not just wrap libxml2? It's widely 
regarded as a fast, stable, portable and *correct* XML library. I wrote a 
partial libxml2 wrapper (mostly the tree.h stuff, and some libxslt) in 
under an hour as a learning exercise; someone with real D chops could 
turn out a polished interface in short time.

The fact that libxml2/libxslt support not only XML parsing and DOM 
building, but also XSLT, XPath, XPointer, XInclude, RelaxNG, etc., means 
that any homegrown library will be hard-pressed to cover the same range 
of tools and features.

There are too many half-baked XML libraries in the world. No disrespect 
intended to opticron or anyone else; it just doesn't make a lot of sense 
to reinvent such a complex wheel (and believing that XML processing isn't 
complex is a sure sign that your homegrown library's design is 


More information about the Digitalmars-d mailing list