XInclude
title: "XInclude" type: doc version: 1 created: 2026-02-28 author: "Wikipedia contributors" status: active scope: public tags: ["xml-based-standards"] topic_path: "general/xml-based-standards" source: "https://en.wikipedia.org/wiki/XInclude" license: "CC BY-SA 4.0" wikipedia_page_id: 0 wikipedia_revision_id: 0
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.{{cite web |url=http://www.w3.org/TR/xinclude/#examples |title=XML Inclusions (XInclude) Version 1.0 (Second Edition), Appendix C: Examples (non-normative) |author1=J. Marsh |author2=D. Orchard |author3=Daniel Veillard |publisher=World Wide Web Consortium |access-date=2007-06-28
XInclude is not natively supported in Web browsers, but may be partially achieved by using some extra JavaScript code. |url=https://developer.mozilla.org/en/docs/XInclude |title=XInclude |author1=((Brettz9)) |author2=rolfedh|author3=klez|author4=teoli |display-authors=1 |publisher=Mozilla Developer Network
Example
For example, including the text file license.txt:
This document is published under GNU Free Documentation License
in an XHTML document:
::code[lang=xml]
... ... ::gives:
::code[lang=xml]
... ...This document is published under GNU Free Documentation License
::The mechanism is similar to HTML's `` tag (which is specific to the HTML markup language), but the XInclude mechanism works with any XML format, such as SVG and XHTML.
References
::callout[type=info title="Wikipedia Source"] This article was imported from Wikipedia and is available under the Creative Commons Attribution-ShareAlike 4.0 License. Content has been adapted to SurfDoc format. Original contributors can be found on the article history page. ::