docbook message
[Date Prev]
| [Thread Prev]
| [Thread Next]
| [Date Next]
--
[Date Index]
| [Thread Index]
| [List Home]
Subject: <informalexample> to contain one or more <programlisting> element(s) for amulti-line source code section?
- From: Taro Ikai <tikai@ABINITIO.COM>
- To: docbook@lists.oasis-open.org
- Date: Mon, 7 Jul 2003 16:46:05 -0400
Hi,
http://www.docbook.org/tdg/en/html/informalexample.html
cites an example of <informalexample><programlisting>
block that contains
several lines of source code block
in a single <programlisting> element:
<informalexample>
<programlisting>
sub print_content_model {
my($self) = shift;
local($_) = shift;
local(*FILE) = shift;
my(@cm) = $self->format_content_model2($_);
foreach $_ (@cm) {
print FILE $self->make_links($_, 1, 1),
"\n";
}
}
</programlisting>
</informalexample>
My limited understanding of XML is
that it does not pay attention to
the white spaces or new lines within
CDATA sections. The CYGWIN
distribution of Tidy, for example,
does not not preserve
the new lines within CDATA.
Am I better off to use something like
the following?
<informalexample>
<programlisting>sub print_content_model
{</programlisting>
<programlisting> my($self)
= shift;</programlisting>
<programlisting> local($_)
= shift;</programlisting>
<programlisting> local(*FILE)
= shift;</programlisting>
<programlisting>
my(@cm) = $self->format_content_model2($_);</programlisting>
<programlisting/>
<programlisting> foreach
$_ (@cm) {</programlisting>
<programlisting>
print FILE $self->make_links($_, 1, 1), "\n";</programlisting>
<programlisting> }</programlisting>
<programlisting>}</programlisting>
</informalexample>
Taro Ikai
[Date Prev]
| [Thread Prev]
| [Thread Next]
| [Date Next]
--
[Date Index]
| [Thread Index]
| [List Home]