[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: Re: [docbook-apps] How to handle XML code in programlistings?
Darya Said-Akbari wrote: > Hi, > > I would like to use <programlistingco> for some XML > code. > > Is it possible at all? yes, with two caveats. The easy way. <programlisting> <![CDATA[ <pox/> ]]> </programlisting> Easy, but no markup within the programlisting element. If you need that, you'll have to escape all your xml s/&/&/ s/</</ is not too bad. Then you can do things like <example id="xslfo-CHP-2-EX-1" label="2-1"> <title>A basic page specification</title> <programlisting><?xml version="1.0" encoding="utf-8"?> <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"> <co id="xslfo-CHP-2-EX-1.1"/> <fo:layout-master-set> <co id="xslfo-CHP-2-EX-1.2"/> <fo:simple-page-master page-height="11in" page-width="8.5in" master-name="only"> <co id="xslfo-CHP-2-EX-1.3"/> <fo:region-body region-name="xsl-region-body" <co id="xslfo-CHP-2-EX-1.4"/> margin="0.7in" /> <fo:region-before <co id="xslfo-CHP-2-EX-1.5"/> region-name="xsl-region-before" extent="0.7in" /> <fo:region-after region-name="xsl-region-after" <co id="xslfo-CHP-2-EX-1.6"/> extent="0.7in" /> </fo:simple-page-master> </fo:layout-master-set> <fo:page-sequence master-reference="only" format="A"> <co id="xslfo-CHP-2-EX-1.7"/> <fo:flow flow-name="xsl-region-body"> <fo:block >Some base content, containing an inline warning, <co id="xslfo-CHP-2-EX-1.8"/> <fo:inline >Warning: </fo:inline>Do not touch blue paper, a fairly straightforward piece requiring emphasis <fo:inline font-weight="bold">TEXT</fo:inline>, and some instructions which require presenting in a different way, such as <fo:inline font-style="italic">Now light the blue paper</fo:inline>. </fo:block> </fo:flow> </fo:page-sequence> </fo:root> </programlisting> <calloutlist> <callout arearefs="xslfo-CHP-2-EX-1.1"> <para>The <indexterm id="IXT-2-236323"> <primary>document elements</primary> </indexterm>document element in the <literal>fo</literal> namespace</para> </callout> <callout arearefs="xslfo-CHP-2-EX-1.2"> <para>The <indexterm id="IXT-2-236324"> <primary>layout master</primary> </indexterm>layout master, which wraps the page specification</para> </callout> <callout arearefs="xslfo-CHP-2-EX-1.3"> <para>The <indexterm id="IXT-2-236325"> <primary>pagination</primary> </indexterm>page specification with name <literal>only</literal> </para> </callout> <callout arearefs="xslfo-CHP-2-EX-1.4"> <para>The main <indexterm id="IXT-2-236326"> <primary>body of page</primary> </indexterm>body area of the page</para> </callout> <callout arearefs="xslfo-CHP-2-EX-1.5"> <para>The <indexterm id="IXT-2-236327"> <primary>header area</primary> </indexterm>header area</para> </callout> <callout arearefs="xslfo-CHP-2-EX-1.6"> <para>The <indexterm id="IXT-2-236328"> <primary>footer area</primary> </indexterm>footer area</para> </callout> <callout arearefs="xslfo-CHP-2-EX-1.7"> <para>The <literal>page-sequence</literal>, which refers to the page specification</para> </callout> <callout arearefs="xslfo-CHP-2-EX-1.8"> <para>Some content, wrapped in blocks and inlines, which will appear in the output</para> </callout> </calloutlist> </example> I.e. insert callouts to reference your code? I like that. Helps explain yards of code. HTH regards -- Dave Pawson XSLT XSL-FO FAQ. http://www.dpawson.co.uk
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]