The following example is incorporated by an external entity, merge file order1.xml and file Order2.xml into a file Directory.xml list 1. To merge XML document Order1.xml:
XML Version = "1.0" encoding = "GB2312"?>
- ksu-0384 itemnumber> LCD LCD display description> 1 quantity> 358.00 price> item>
- < ItemNumber> KSU-0511 itemnumber> Speaker description> 1 quantity> 16.50
-
- KSU-7710 itemnumber> Mouse description> 1 quantity> 8.50 price> item> order>
Listing 2. XML document to be merged order2.xml: XML Version = "1.0" encoding = "GB2312"?>
- KSU-0652 itemnumber> Double flying swallow keyboard description> 1 quantity> 35.00 price>
- < Itemnumber> KSU-7720 itemnumber> Intel CPU description> 1 quantity> 1650.00
-
-
- KSU-7010 Mai Tuo hard drive description> 1 quantity> 850.00 price> item> order>
Listing 3. Output Document Directory.xml, the black body part is an entity declaration and its reference:
XML Version = "1.0"?> & disclaimer1; & disclaimer2; Directory> When the processor complies with XML 1.0 is read, the entity is expanded, and the content is replaced with its content, so the complete document is as follows. Listing 4. Document display with extended entities (IE6):