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

 


Help: OASIS Mailing Lists Help | MarkMail Help

docbook-apps message

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


Subject: Re: [docbook-apps] Discard leading/trailing whitespace in <title>elements?


Martin Wheeler wrote:

>> Why not just use <para>Some text here.</para>?
> 
> 
> Probably for the same reason that you don't use:
> <para>Some text here.</para><para>Some more text here.</para><para>Yet 
> more text here.</para><para>Still further text here.</para>

These two examples are completely different. Element para has mixed 
content -- it can contain both text and nested elements (links, phrase 
markup, etc.) on the same level. In mixed content you must preserve all 
whitespace and thus it is not safe to use whitespace to pretty-print 
your XML source. So writing

<para>
Some text here.
</para>

is always bad, because you have space before first word "Some". You will 
not notice this space in most output formats, because processing rules 
of HTML and XSL-FO discrad this sort of spaces. But this is not general 
rule and some tools will show this space -- try DSSSL stylesheets and 
RTF output. You will get very ugly output.

OTOH it is your choice whether you write:

<para>Some text here.</para><para>Some other text here.</para>

or

<para>Some text here.</para>
<para>Some other text here.</para>

or even

<para>Some text here.</para>

<para>Some other text here.</para>

It is because parent (typically section or chapter) of element para 
doesn't have mixed content, it can directly contain only other elements. 
In this case processing tools know that whitespace between para elements 
is insignificant and can be safely discarded.

-- 
------------------------------------------------------------------
   Jirka Kosek     e-mail: jirka@kosek.cz     http://www.kosek.cz
------------------------------------------------------------------
   Profesionální školení a poradenství v oblasti technologií XML.
      Podívejte se na náš nově spuštěný web http://DocBook.cz
        Podrobný přehled školení http://xmlguru.cz/skoleni/
------------------------------------------------------------------

S/MIME Cryptographic Signature



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