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.

  

back to top