Closed jmdavis closed 6 years ago
FYI we forked https://github.com/dlang-community/discussions/issues/23 to https://github.com/dlang-community/experimental.xml, s.t. further development can happen at a common place.
@lodo1995 isn't active anymore and I would encourage you to resubmit to resubmit the PR to the dlang-community fork. Unfortunately we weren't able to reach @lodo1995
With the way the import was done previously, if code imported std.xml and it tried to use NodeType, it got an error about it being undefined.
I don't know why the import for the dom module was different from all of the others, and there may be a good reason for it that makes this change a bad idea, but as the code was, using NodeType did result in an error.
On a related note, as far as improvements go, it would be nice to have a way to indicate that you want all comments stripped from your parse results. I ran into this problem with NodeType, because I was having to check for comments so that I could ignore them rather than giving an error when an XML document had a tag in it that it wasn't supposed to.
One improvement that I was very glad to see though was that it's no longer required to create the the DomBuilder and then separately set the source type. It's much nicer to be able to just do it all in one line:
Though I confess that upon seeing something like this, I tend to think that it should be possible to do something like
and have the domBuilder function do all of the rest. The full version is likely useful to have in some circumstances such that the whole chain should still be possible, but it does seem awfully verbose if what you want is to basically just parse the XML and get the result.