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] computeroutput vs screen vs xmllint


Bonjour Mathieu,

   We are internally using different docbook editors (vi, emacs, serna
and xmlmind). To some extent, we would like to preserve a nice and
clear history of revision of our XML files in SVN (subversion). For
this we use a script based on xmllint --format to reformat to a unique
presentation. This has work quite well until today. Could someone
please let me know if the following situation is an issue with either
XML or docbook itself:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd";>
<article>
   <section>
     <title>Introduction</title>
     <para>Before</para>
     <screen><computeroutput>a.txt
b.txt
</computeroutput>
</screen>
     <para>After</para>
   </section>
</article>

while xmllint --format prefers:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd";>
<article>
   <section>
     <title>Introduction</title>
     <para>Before</para>
     <screen>
       <computeroutput>a.txt
b.txt
</computeroutput>
     </screen>
     <para>After</para>
   </section>
</article>

The latter is wrong. Stuff within "verbatim" containers such as <screen> or <programlisting> shouldn't be re-formatted at all, but rather preserved as is.

I'd suggest using Paul DuBois' XML Formatter which does what it's supposed to do. It's included in many Linux distros already, but if it's not in yours (or if you're not using Linux) you can find it here:

http://www.kitebird.com/software/xmlformat/

This leads to differences in the fo output with extra spaces. So how
does one handles such corner cases ?

By formatting (or not formatting) properly. :-)

--
Cheers,

Stefan Hinz <stefan.hinz@oracle.com>, MySQL Documentation Manager

Phone: +49-30-82702940, Fax: +49-30-82702941, http://dev.mysql.com/doc

ORACLE Deutschland B.V.&  Co. KG
Registered Office: Riesstr. 25, 80992 Muenchen, Germany
Commercial Register: Local Court Of Munich, HRA 95603
Managing Director: Jürgen Kunz

General Partner: ORACLE Deutschland Verwaltung B.V.
Hertogswetering 163/167, 3543 AS Utrecht, Niederlande
Register Of Chamber Of Commerce: Midden-Niederlande, No. 30143697
Managing Directors: Alexander van der Ven, Astrid Kepper, Val Maher


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