XInclude

from Wikipedia, the free encyclopedia

XML Inclusions , or XInclude for short , is a W3C recommendation that enables parts of other XML or text documents to be referenced within XML documents . These "references" are replaced by the content of the referenced documents during the dissolution process.

The following example references the XML file foo.xml:

 <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
   href="foo.xml"/>

If you want to refer to a text file bar.txt:

 <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
   parse="text"
   href="bar.txt"/>

The difference between XML and text references is that the contents of referenced text documents are not processed by the XML parser , but rather, like a CDATA section, are inserted exactly as they are in the referenced document.

In contrast to text documents, which can only be referenced as a whole, XInclude also allows only parts of an XML document to be referenced. Such partial documents are addressed using the XPointer .

See also

  • XPath - a query language to address parts of an XML document

literature

  • Margit Becher: XML: DTD, XML-Schema, XPath, XQuery, XSLT, XSL-FO, SAX, DOM . W3L-Verlag, Herdecke, Witten 2009, ISBN 978-3-937137-69-8 .

Web links