Nested XML files

Usha_R2 at Usha_R2 at
Wed Oct 14 14:17:23 BST 1998

Hi! All,
   We can have a DTD as a collection of DTD files. Similarly, can a XML
file contain other xml files. 

Consider the following example:




Now I use this in file1.dtd 


<!ELEMENT file1 (X+ , Y)>
<!ENTITY  % file2 SYSTEM "file2.dtd">


Defining File1.xml as follows:


<?xml version="1.0"?>
<!DOCTYPE file1 SYSTEM "file1.dtd">


Now in File1.xml, I can have both "X" and "Y" elements. 

Can I use one xml file in another. For example instead of defining <Y>
element again in File1.xml, suppose if I have File2.xml as follows:




How do I use these in File1.xml again. Can I define an external entity
for an .xml file also. I tried this and it seems to be giving some
problems. Please let me know if its possible.

Thanks in advance

K. Usha Rani
Dept        : Applications
Phone    : (080) - 2869920
Email     :  usha_r2 at

xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev at
Archived as:
To (un)subscribe, mailto:majordomo at the following message;
(un)subscribe xml-dev
To subscribe to the digests, mailto:majordomo at the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa at

More information about the Xml-dev mailing list