OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

docbook message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: Re: <informalexample> to contain one or multiple <programlisting>element(s) for a multi-line source code block?


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

/ Taro Ikai <tikai@ABINITIO.COM> was heard to say:
| 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. 

CDATA sections are just an escaping hack. But the above example
doesn't have any CDATA in it anyway.

Whitespace and newlines in programlistings are significant.

| The CYGWIN 
| distribution of Tidy, for example, does not not preserve 
| the new lines within CDATA. 

Tidy is only for cleaning up HTML. And even in HTML, it has no business
deleting newlines or spaces from elements where character data is allowed.

| <informalexample>
|   <programlisting>sub print_content_model {</programlisting>
|   <programlisting>&nbsp;&nbsp;my($self) = shift;</programlisting>
|   <programlisting>&nbsp;&nbsp;local($_) = shift;</programlisting>
|   <programlisting>&nbsp;&nbsp;local(*FILE) = shift;</programlisting>
|   <programlisting>&nbsp;&nbsp; my(@cm) = 
| $self->format_content_model2($_);</programlisting>
|   <programlisting/>
|   <programlisting>&nbsp;&nbsp;foreach $_ (@cm) {</programlisting>
|   <programlisting>&nbsp;&nbsp;    print FILE $self->make_links($_, 1, 1), 
| "\n";</programlisting>
|   <programlisting>&nbsp;&nbsp;}</programlisting>
|   <programlisting>}</programlisting>
| </informalexample>

Absolutely not.

                                        Be seeing you,
                                          norm

- -- 
Norman Walsh <ndw@nwalsh.com>      | Men of genius do not excel in any
http://www.oasis-open.org/docbook/ | profession because they labor in
Chair, DocBook Technical Committee | it, but they labor in it because
                                   | they excel.--William Hazlitt
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: Processed by Mailcrypt 3.5.7 <http://mailcrypt.sourceforge.net/>

iD8DBQE/FzLeOyltUcwYWjsRArDAAKCVTtzGgGkLCNsbxpQndh1aizCrhACaAivP
hAKb44eVdSBgiwcmWQLDVUo=
=SRRh
-----END PGP SIGNATURE-----


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]