XML technologies / DocBook / Block elements / Program listings / Including external files with xi:include
(Excerpt from "DocBook-XML: Media-neutral and platform-independent publishing" by Thomas Schraitle)
If your XSLT processor has no extension function for textdata, reference the external file using the element xi:include. DocBook 4 does not include this element, but DocBook 5 provides it. For more information about xi:include, see Including content with XIncludes.
Example: Reading external text with XInclude
<programlisting><xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="pytest.py" parse="text"/></programlisting>When using XInclude, make sure the attribute parse is set to text. This prevents the file from being interpreted as XML code.
Copyright © 2009 Millin Verlag
You may print the online version for your private use.
Otherwise, this chapter from "DocBook-XML: Medienneutrales und plattformunabhängiges Publizieren" is subject to the same provisions as the printed edition: the work, including all its parts, is protected by copyright. All rights are reserved, including reproduction, translation, microfilming, and storage and processing in electronic systems.
Millin Verlag, Siebengebirgsring 36, 53797 Lohmar, info(at)millin.de
back to top