On 12/02/2018 10:02 PM, H. S. Teoh wrote:
On Mon, Feb 12, 2018 at 02:54:48PM +0000, rikki cattermole via 
Digitalmars-d-announce wrote:
[...]
Everything you have mentioned is not in Phobos. Just because something
is 'good enough' does not make it 'good enough' for Phobos. In the
words of Andrei "Good enough is not good enough", we need to aim
higher to show what we actually can do.

And thus Phobos continues to let the perfect be the enemy of the good,
and 10 years later std.xml will still be around, and we will still be
arguing over how to replace it.


Personally I find J.M.D. arguments quite reasonable for a third-party
library, since yes it does cover 90% of the use cases.

As I have just said in another post, dxml itself does not need to be
changed to implement DTD support.  It's perfectly possible to write a
wrapper on top of it that *does* implement DTD support.  In fact, I dare
say it might be possible to lazily switch from a thin wrapper over dxml
to full DTD mode, so that end users don't even need to care about the
difference if they don't care to.

As far as API is concerned, it could be as simple as something like:

        auto parseXml(R, DtdSupport = dtdSupport.true)(R input) if (...)
        {
                static if (DtdSupport)
                        return dtdWrapper(dxmlParse(input));
                else
                        return dxmlParse(input);
        }

Then just note in the documentation that turning off DTD support would
provide extra features X, Y, and Z (speed, slices, whatever). Then let
the user choose.

Seriously, I would have thought something like this would be obvious to
programmers of the calibre found on these forums.  I'm a little
astonished that this would even be such a point of contention in the
first place, since the solution is so simple.


T

In other places it was said that it wasn't possible to build it on top of it.

But yes, I would be expecting an entry point like you described and is something that I mentioned :)

std.experimental.xml:
        - interfaces.d: interface Element {...}
        - entry.d: auto parseXML(...)(...) {...}
        - impl_subset:
                - dom.d
                ext.
        - impl_full:
                - entry.d
                ext.


            • ... Jonathan M Davis via Digitalmars-d-announce
            • ... Nick Sabalausky (Abscissa) via Digitalmars-d-announce
            • ... Kagamin via Digitalmars-d-announce
      • Re: dxml 0.... Chris via Digitalmars-d-announce
        • Re: dxm... rikki cattermole via Digitalmars-d-announce
          • Re:... Adam D. Ruppe via Digitalmars-d-announce
            • ... rikki cattermole via Digitalmars-d-announce
              • ... Jonathan M Davis via Digitalmars-d-announce
              • ... rikki cattermole via Digitalmars-d-announce
          • Re:... H. S. Teoh via Digitalmars-d-announce
          • Re:... rikki cattermole via Digitalmars-d-announce
          • Re:... Nick Sabalausky (Abscissa) via Digitalmars-d-announce
          • Re:... Russel Winder via Digitalmars-d-announce
      • Re: dxml 0.... Adam D. Ruppe via Digitalmars-d-announce
      • Re: dxml 0.... bachmeier via Digitalmars-d-announce
        • Re: dxm... bachmeier via Digitalmars-d-announce
          • Re:... Jonathan M Davis via Digitalmars-d-announce
  • Re: dxml 0.2.0 relea... Johannes Loher via Digitalmars-d-announce
  • Re: dxml 0.2.0 relea... Jesse Phillips via Digitalmars-d-announce

Reply via email to