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


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

Re: DocBook: whitespace question.


/ Brendan J Simon <Brendan.Simon@ctam.com.au> was heard to say:
| I have a question about whitespaces in SGML/XML documents.

The rules are quite different for SGML and XML. For SGML, there
are some quite complex rules, including some that come into play
immediately after a start tag and immediately before an end tag.
In XML, the rules are simple: all whitespace must be passed to
the application, but the parser may indicate that some
whitespace is insignificant (in element content, whitespace is
insignificant).

| I prefer whitespaces to clearly seperate the tags from the text.
| <para> This is a sentence. </para>
| 
| Infact I usually put tags on seperate lines and indent the text for
| extra readability.
| <para>
|     This is a single sentence but there could be many more in this
| paragraph.
| </para>

In mixed-content (in elements that may contain character data),
all whitespace is significant.

| I don't have any rendering problems with these so I assume it is OK.  I

It's OK as long as you don't have rendering problems, but a
rendering engine that inserted extra spaces would not be
incorrect.

| do notice that when I use customized entities or other tags, that I can
| run into problems, especially when special characters are involved (eg.
| punctuation).
| <para> I will emphasise the word <emphasis> sentence </emphasis> .
| </para>
| There is a space before the period which is not correct.

No, the space *is* correct. You put a space in there :-)

| I have to write
| <para>I will emphasise the word <emphasis> sentence</emphasis>. </para>
| or
| <para> I will emphasise the word <emphasis> sentence. </emphasis> .
| </para>
| 
| Should DocBook recognise that a period comes directly after a word and
| remove the space ?

No. DocBook describes the semantic content of your document, where you
put punctuation is your business. And I don't know of any rendering
engine that would remove a space between a word and a period.

                                        Be seeing you,
                                          norm

-- 
Norman Walsh <ndw@nwalsh.com>      | Curiosity never killed anything
http://www.oasis-open.org/docbook/ | except maybe a few hours.
Chair, DocBook Technical Committee |


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