dxml 0.2.0 released

Jonathan M Davis newsgroup.d at jmdavisprog.com
Mon Feb 12 14:04:38 UTC 2018


On Monday, February 12, 2018 12:38:51 Chris via Digitalmars-d-announce 
wrote:
> On Monday, 12 February 2018 at 05:36:51 UTC, Jonathan M Davis
>
> wrote:
> > dxml 0.2.0 has now been released.
> >
> > I really wasn't planning on releasing anything this quickly
> > after announcing dxml, but when I went to start working on DOM
> > support, it turned out to be surprisingly quick and easy to
> > implement. So, dxml now has basic DOM support.
> >
> > [...]
>
> Will this replace `std.xml` one day?

Maybe. That depends on community feedback and ultimately on the Phobos
review process. Assuming that there's support for putting it through the
Phobos review process, then once I feel that it's complete enough and had
enough use to make it clear that I didn't miss something critical, then I'll
submit it for review.

What little feedback there has been thus far has been positive, but it would
be nice to get it battle-tested a bit, and there is still functionality that
I need to add.

Given that std.xml needs to be replaced, I think that it would be good if
dxml were able to do that, but that depends heavily on what others think of
what I've done and what they think Phobos' xml solution should look like.
But the way things are going though, if dxml doesn't replace std.xml, I
don't know that anything ever will. XML parsers are one of those things that
everyone seems to want and no one seems to want to work on.

However, if folks as a whole think that Phobos' xml parser needs to support
the DTD section to be acceptable, then dxml won't replace std.xml, because
dxml is not going to implement DTD support. DTD support fundamentally does
not fit in with dxml's design. Someone would basically have to write an
entirely new parser to be able to handle it (some of dxml's internals could
be reused, but they'd also have to be refactored a fair bit, and a ton of
extra stuff would have to be added). Such a parser could theoretically
coexist with dxml's parser, since each would provide its own advantages, but
I have no plans to implement an XML parser to handle the DTD section. It's
simply not worth my time or effort, and this project has already taken way
more time and effort than I anticipated.

However, std.xml does not support the DTD section, and glancing over it, it
doesn't look like it even handles skipping the DTD section properly (it
doesn't handle the fact that '>' can appear within quoted sections within
the DTD). So, dxml is not worse than std.xml in that regard, and we wouldn't
lose any functionality by having dxml replace std.xml. It just wouldn't
necessarily do as much as some folks might like.

My guess is that DTD support won't be a deal breaker given that std.xml
doesn't support it, that std.xml has needed to be replaced for years now,
and that no one else is working on replacing it, but I don't know.
Disagreements over what should be done with std.json's replacement has meant
that it has never been replaced even though significant work was done
towards replacing it, so unfortunately, there's already precedence for a
module not being replaced with something better due to disagreements over
what the replacement would ideally be. So, I don't know.

- Jonathan M Davis



More information about the Digitalmars-d-announce mailing list