XInclude
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.[1] 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.
Example
For example, including the text file license.txt
:
This document is published under GNU Free Documentation License
in an XHTML document:
<?xml version="1.0"?>
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:xi="http://www.w3.org/2001/XInclude">
<head>...</head>
<body>
...
<p><xi:include href="license.txt" parse="text"/></p>
</body>
</html>
gives:
<?xml version="1.0"?>
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:xi="http://www.w3.org/2001/XInclude">
<head>...</head>
<body>
...
<p>This document is published under GNU Free Documentation License</p>
</body>
</html>
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.
Web browser support
- Not natively.
- Partially using some extra JavaScript code[2]
gollark: Essentially, magical civilization is FILLED with bees. Or at least British magical civilization. It might be fine elsewhere.
gollark: Oh, and their prison which tortures people into insanity, and this is seen as a feature?
gollark: There *were* those people tortured into insanity.
gollark: IIRC there's an offhand mention to flying carpets, *being banned* due to apioformic tradition by the ministry.
gollark: WHO thought "hmm, I can make arbitrary objects fly. Why don't I put said flight thing on a really thin object which is not merely irritating to sit on but also hard to control?"‽
See also
References
- J. Marsh; D. Orchard; Daniel Veillard. "XML Inclusions (XInclude) Version 1.0 (Second Edition), Appendix C: Examples (non-normative)". World Wide Web Consortium. Retrieved 2007-06-28.
- Brettz9. "XInclude". Mozilla Developer Network.
External links
- XInclude Standard
- XInclude with XSLT
- Using XInclude in Xerces
- Using XInclude article by Elliotte Rusty Harold
This article is issued from Wikipedia. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.