This is the mail archive of the docbook-apps@lists.oasis-open.org mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]