Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
XInclude
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
'''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.<ref>{{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 }}</ref> 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. XInclude is not natively supported in Web browsers, but may be partially achieved by using some extra [[JavaScript]] code.<ref> {{cite web |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]] }}</ref> == Example == For example, including the text file <code>license.txt</code>: This document is published under GNU Free Documentation License in an [[XHTML]] document: <syntaxhighlight lang="xml"> <?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> </syntaxhighlight> gives: <syntaxhighlight lang="xml"> <?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> </syntaxhighlight> The mechanism is similar to [[HTML]]'s <code><object></code> tag (which is specific to the HTML [[markup language]]), but the XInclude mechanism works with any XML format, such as [[Scalable Vector Graphics|SVG]] and [[XHTML]]. == See also == * [[XPath]] == References == <references/> == External links == * [http://www.w3.org/TR/xinclude/ XInclude Standard] * [http://www.xml.com/pub/a/2007/03/28/xinclude-processing-in-xslt-with-xipr.html XInclude with XSLT] * [http://xerces.apache.org/xerces2-j/faq-xinclude.html Using XInclude in Xerces] * [https://www.xml.com/pub/a/2002/07/31/xinclude.html Using XInclude] article by Elliotte Rusty Harold {{W3C standards}} {{DEFAULTSORT:Xinclude}} [[Category:XML-based standards]]
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)
Pages transcluded onto the current version of this page
(
help
)
:
Template:Cite web
(
edit
)
Template:W3C standards
(
edit
)