
Sebastian Redl wrote:
Stefan Seefeld wrote:
I don't understand what you are aiming at in your comment about the 'document schema'.
I mean that there is no way in the current API to obtain information about the document type, beyond its name and location.
But the DTD may not be available itself. And in fact, for XSchema, RelaxNG, etc., there isn't even a reference to those in the document, so not even the name is available. (But this discussion suggests that in fact I may remove the DTD-related accessors from the document interface and make it freestanding. It may then evolve independently.)
That's an implementation detail (IMO). No, it's not. It's a matter of public derivation of classes and thus very much an interface issue. Semantically, a text node and a cdata node are distinct, Also not true, at least as far as Infoset is concerned. See also Appendix D of the Infoset spec, item 19.
OK, will read that.
and so visitors shouldn't give users access to a cdata node as a text node. (And what else would the ISA relationship be good for ?)
But that's exactly what they should do (if the user wants to ignore the difference). CDATA, as I said before, is a serialization issue, and completely irrelevant to a user who just wants to know what text the document contains.
OK.
I'm sure this can be refined. (In fact, I don't think DTDs will play any significant role in the future, as other document type definitions become more popular, such as relaxng).
True. Perhaps an API for generalized schema access can be devised.
Yes, but that would be a separate API, independent from my current proposal. (Which is a good thing, as it favors modularity. Users who don't need validation don't have to pay for it.) Regards, Stefan -- ...ich hab' noch einen Koffer in Berlin...