XML technologies / DocBook / Block elements / Program listings / Including external files with textobject
(Excerpt from "DocBook-XML: Media-neutral and platform-independent publishing" by Thomas Schraitle)
If you need the source code in a separate file, reference it using textdata inside textobject. Note that this works only if an extension function is available in your XSLT processor. The following example shows how to use textobject and textdata.
Example: Reading external text with textobject and textdata
<programlisting><textobject><textdata fileref="pytest.py"/></textobject></programlisting>The example above includes Python code from the file pytest.py. This lets you change the source code independently of the documentation.
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