Text inclusions

The assumption made so far is that XML material is to be inserted. But material to be included can also be treated as simple 'text' data. The Parse attribute is used to indicate how the material is to be treated:

<xi:include href="quote.txt" parse="text" />

Although unnecessary, this attribute can also take the value 'xml', to make the default action explicit. In 'xml' mode, the included fragment must conform to XML well-formed rules, and will be parsed for further Include elements (it is therefore assumed that an XML parser will be used to read this resource, and may reject it if it does not conform to XML rules).

In 'text' mode, XML parsing is not desired, regardless of whether or not the fragment happens to consist of XML ...

Get XML Companion, The, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.