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: [docbook] <informalexample> to contain one or multiple <programlisting>element(s) for a multi-line source code block?


Taro Ikai wrote:

> <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 

This example is perfectly OK. In XML almost all whitespace in element 
content shouldn't be discarded. Thus you should omit new line right 
after start tag and right before end tag:

<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>

> distribution of Tidy, for example, does not not preserve 
> the new lines within CDATA. 

Tidy is tool for cleaning up HTML code, not XML processor.

-- 
-----------------------------------------------------------------
   Jirka Kosek  	
   e-mail: jirka@kosek.cz
   http://www.kosek.cz

S/MIME Cryptographic Signature



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