John L. Clark wrote: > On Fri, Oct 08, 2004 at 10:36:48AM +0200, Hussein Shafie wrote: > >>DTD-less DocBook files are not *documents*. You can call them fragments, >>modules, external entities, whatever. > > > They may not be DocBook *documents*, but they are certainly XML > *documents*. (In the prolog, the doctypedecl is optional[0].) I want > to summarize what I believe are your conclusions before I go on. If I > understand what you've said in your response correctly, XXE will always > save files as either XML fragments or well-formed XML documents (and as > we have seen, neither set is a subset of the other). I had simply > expected XXE to always save well-formed XML documents. > > I realize now that my expectation was unreasonable because it is useful > for XXE users to be able to edit XML fragments as fragments. Further, I > can disable this XML fragment editing behavior with an XXE option[1]. > > To try to justify why this "makes me uncomfortable", however, I can > still anticipate cases where a user would perceive such a DTD-less file > as an instance of a particular vocabulary. In this mode of operation, a > well-formed XML document would be determined to be a valid document in a > particular language (such as DocBook) by an external validation process. > This allows for alternate validation mechanisms (besides DTDs) and a > modular approach to validation. In fact, this has been my mindset all > along, and that extended to my use of XXE, which has always seemed to me > to have a novel and elegant way of deciding how to validate a particular > document.
(I'm not sure that this is the answer you expect.) The only thing you have to do to force XXE to always generate XML files: * loadable (as standalone XML documents) by other XML software. * than can be validated using ``modern'' grammars such as RelaxNG or W3C XML Schemas which (IMHO *fortunately*) have no concept of entity. is to ban the use of character entities. You can do this with the Options dialog box, Save tab: turn off "Save characters outside encoding as entity references" You can do that with the <saveOptions> configuration element: --- <saveOptions saveCharsAsEntityRefs="false"/> --- See http://www.xmlmind.com/xmleditor/_distrib/docs/configure/ch06s19.html This means disabling a feature added in XXE V2.5 Patch 2 (January 26, 2004) because most users seem to like generating ``highly-human-readable'' XML files, even if this means tying themselves to DTDs, entities, etc.

