Ref: http://www.informatik.tu-darmstadt.de/DVS1/staff/bourret/xml/NamespacesFAQ.htm [8.5: How can I use XML namespaces to combine documents that use different DTDs?] To combine documents that use different DTDs, you first need to construct a new DTD from the existing DTDs, changing content models if necessary. You can then combine the documents so that they fit the new DTD. The procedure for doing this is depressingly simple and, unfortunately, not automated, nor is it ever likely to be automated. - Not sure why a depressingly simple procedure can't be automated. In general, it's wrong to think of "combining" DTDs. The better approach is to define a new DTD and "delegate" the component parts. This is especially true in cases of pure composition, such as in the example of Departments combining Addresses and Servers. From the Departments DTD perspective, it really doesn't matter what
or contains *if the intent* is to delegate the authority for such content to the other DTDs. Thus: Given this, the 'Departments' structure of the document can be validated *indpendently* of the detailed structure of
and , and similarly these detailed structures can be validated each with respect to the *relevant* DTD. The "problem" doesn't exist. This directory demonstrates this, using the examples from Section 8.5 of the Namespaces FAQ document. NOTES: 1. I'm using nsgmls and a SGML set-up. The modifications for XML are straightforward. 2. Because it's SGML, I have a "bogus" DTD, called 'any.dtd' so that nsgmls doesn't squawk: the effect is to duplicate well-formedness. 3. Look at session.txt, which demonstrates that architectural instances can be extracted with almost no markup besides the declarative stuff needed to set up the transformation. 4. Note that the name clash of "Address" in the second example is actually *retained* (!!) via a factitious element 'Foo'. The point is to demonstrate the concept and utility of attribute-based processing.