1 <?xml version="1.0" encoding="utf-8"?>
\r
2 <chapter xml:id="style-pi" xmlns="http://docbook.org/ns/docbook" version="5.0" xml:lang="EN"
\r
3 xmlns:xi="http://www.w3.org/2001/XInclude" xmlns:xlink="http://www.w3.org/1999/xlink">
\r
5 <title>Processing instructions</title>
\r
8 <para>Processing instructions (PIs) are written into the xml when the desired output cannot be
\r
9 achieved with DocBook elements and attributes alone. PIs may also be used to force special
\r
10 formatting in only part of a document. For a more technical introduction see Bob Stayton's
\r
11 <link xlink:href="http://www.sagehill.net/docbookxsl/ProcessingInstructions.html"
\r
12 xlink:title="http://www.sagehill.net/docbookxsl/ProcessingInstructions.html">DocBook
\r
13 XSL: The Complete Guide</link>. There are also lists of DocBook-specific processing
\r
14 instructions for <link
\r
15 xlink:href="http://docbook.sourceforge.net/release/xsl/current/doc/pi/pi-html.html"
\r
16 xlink:title="http://docbook.sourceforge.net/release/xsl/current/doc/pi/pi-html.html"
\r
17 >html</link> and <link
\r
18 xlink:href="http://docbook.sourceforge.net/release/xsl/current/doc/pi/pi-fo.html"
\r
19 xlink:title="http://docbook.sourceforge.net/release/xsl/current/doc/pi/pi-fo.html"
\r
20 >pdf</link> output.</para>
\r
22 <para>PIs should be used sparingly: it is easier to maintain documents that achieve the desired
\r
23 output with DocBook elements and <link
\r
24 xlink:href="http://docbook.sourceforge.net/release/xsl/current/doc/html/index.html"
\r
25 xlink:title="http://docbook.sourceforge.net/release/xsl/current/doc/html/index.html"
\r
26 >stylesheet parameters</link>. However, there are a few cases where PIs may be
\r
32 <title>Force line break</title>
\r
33 <para>Line breaks should not be used for spacing between elements; this is much
\r
34 better done with CSS and XSL. Hoever, if entering multiple lines that must be
\r
35 displayed in succession but without the separation of a new paragraph, you may
\r
36 use the linebreak PI. The following code</para>
\r
39 <![CDATA[<para>First line <?linebreak?>Second line <?linebreak?>Third line</para>]]>
\r
41 <para>Will output</para>
\r
42 <informalexample><para>First line <?linebreak?>Second line <?linebreak?>Third line</para></informalexample>
\r
44 <caution><para>This only works if
\r
45 custom stylesheets include the following code, described in <link
\r
46 xlink:href="http://www.sagehill.net/docbookxsl/LineBreaks.html"
\r
47 xlink:title="http://www.sagehill.net/docbookxsl/LineBreaks.html">Bob Stayton's
\r
48 DocBook XSL</link>. Sitka's customization layer includes this template as of June
\r
51 <![CDATA[<xsl:template match="processing-instruction('linebreak')">
\r
58 <formalpara><title>Include external content</title><para>To insert external content into the html output use the <emphasis>dbhtml-include</emphasis> processing instruction as described in <link xlink:href="http://www.sagehill.net/docbookxsl/InsertExtHtml.html#CodeInPage" xlink:title="http://www.sagehill.net/docbookxsl/InsertExtHtml.html#CodeInPage">DocBook XSL</link>.
\r
59 This could be used to add a custom search box to the title page, an animated tutorial in the relevant section, or any other content in valid xhtml.</para></formalpara>
\r