XInclude is a generic mechanism for merging XML documents, by writing inclusion tags in the "main" document to automatically include other documents or parts thereof. The resulting document becomes a single composite XML Information Set. The XInclude mechanism can be used to incorporate content from either XML files or non-XML text files.
For example, including the text file license.txt
:
in an XHTML document:
gives:
The mechanism is similar to HTML's <object>
tag (which is specific to the HTML markup language), but the XInclude mechanism works with any XML format, such as SVG and XHTML.