The error is using the wrong tools. I edit pretty large xml files in emacs quite a lot. I also use nxml-mode with xml-mode and believe me hacking that 4 liner to the bottom of the file is the easier option.
I've gotta side with Dave on this one. The emacs 'Local Variables' approach allows you to open up any of the 'child' docs and immediately start editing in DTD-aware mode. (Emacs then automatically loads the top-level parent file.)
Also, as soon as you change the internal subset of the DTD, by, e.g. , adding a new entity, you *must* recompile the DTD because the DTD itself has been changed.
Regarding the indenting issue: I've heard this is a problem for translation, but one should be still be able to produce reasonable diffs w/ some work around. Or someone could test the GPL tool 'xmldiff'[1], to see if it cares about indentation.
FWIW, I use a slightly different form of the local varable statement than Dave; mine specifies three quantities:
- top-level-parent-document
- top-level-element-in-parent-doc
- top-level-element-in-this-doc
e.g., for a chapter file, I'd have this at the end:
<!-- Keep this comment at the end of the file Local variables: mode: xml sgml-parent-document:("parent-file.xml" "book" "chapter") End: -->
My $0.02, Mark
[1] http://www.logilab.org/projects/xmldiff/
If you are bothered by the indents, fix the elisp for sgml-mode, or ask on psmgl-list for Lennart to do it!
-- ---------------------------------------------------------- Mark Johnson <mjohnson@xxxxxxxxxx> OS Product Documentation Engineering, Red Hat, Inc. <http://www.redhat.com> Tel: 919.754.4151 Fax: 919.754.3708 GPG fp: DBEA FA3C C46A 70B5 F120 568B 89D5 4F61 C07D E242