[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: Re: [docbook-apps] computeroutput vs screen vs xmllint
On Tue, Sep 11, 2012 at 11:33 AM, Stefan Hinz <stefan.hinz@oracle.com> wrote: > Bonjour Mathieu, > > >> On Tue, Sep 11, 2012 at 10:01 AM, Stefan Hinz <stefan.hinz@oracle.com> >> wrote: >>>> >>>> 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/ >> >> >> $ wget http://www.kitebird.com/software/xmlformat/xmlformat-1.04.tar.gz >> $ tar xvfz xmlformat-1.04.tar.gz >> $ cd xmlformat-1.04 >> $ cp xmlformat.pl /usr/local/bin/xmlformat >> $ xmlformat input.xml > new.xml >> $ cat new.xml >> <?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> >> >> >> This is *exactly* what I am trying to avoid. xmllint and xmlformat >> seems to produce the exact same output. Is it working as supposed on >> your machine ? Which version are you using ? > > > Darn, sorry for that. :-( > > I guess xmlformat-1.04 still doesn't include the setting it includes in our > setup here: > > atlas~/svn/mysqldoc-toolset/tools> grep screen xmlformat.conf > programlisting literallayout synopsis screen > > In other words, add "screen" to the respective line of xmlformat.conf, and > things should work properly. magnificent ! Thanks a bunch -- Mathieu
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]