Erik Leunissen wrote:
> I've composed an xml-docbook document (a manual page) that contains a 
> programlisting element.
> 
> When saving and closing the document, next reloading it, the 
> programlisting is depicted as a single line, i.e. all line endings seem 
> to have disappeared. This happens under Linux as well as Windows 2000, 
> when using XMLeditor V2.4 standard edition.
> 
> I checked that freshly created documents in which I edit a dummy program 
> listing, do not exhibit this strange behaviour. This probably means that 
> the reported behaviour is to some extent specific for the manual page.
> 
> - Is this behaviour recognized?
> - Did I screw up something? If so what? (everything alse works as it 
> should). I wonder whether it may have to do with editing the document 
> with both windows and Linux based versions of XMLeditor.
> - Can it be fixed, worked around?
> 
> If desired, I can send the document for inspection.

Some of the DTDs bundled with XMLmind XML Editor have been modified. 
This document 
http://www.xmlmind.com/xmleditor/_distrib/docs/user/userguide5.html#id.s5 
explains how and why.

Freshly created documents use such modified DTDs. Your manual page don't.

Template documents bundled with XXE either:
[1] begin with (example "Article").

---
<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
   "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd";>
---

[2] have no <!DOCTYPE> at all (example, "Chapter (part of a master 
document)").

For first case, DTD with public ID "-//OASIS//DTD DocBook XML V4.2//EN" 
is declared in the catalog.xml bundled with XXE like this:

XXE_install_dir/config/catalog.xml:
---
<public publicId="-//OASIS//DTD DocBook XML V4.2//EN"
           uri="docbook/dtd/V4.2/docbookx.dtd"/>
---

With such catalog.xml, XXE will use local, modified, docbookx.dtd 
instead of downloading remote, original, docbookx.dtd from OASIS.

For second case, DocBook configuration file 
XXE_install_dir/config/docbook/docbook.xxe specifies:

---
   <detect>
     <and>
       <or>
        <rootElementLocalName>book</rootElementLocalName>
        <rootElementLocalName>article</rootElementLocalName>
        <rootElementLocalName>chapter</rootElementLocalName>
        <rootElementLocalName>appendix</rootElementLocalName>
        <rootElementLocalName>section</rootElementLocalName>
        <rootElementLocalName>sect1</rootElementLocalName>
        <rootElementLocalName>sect2</rootElementLocalName>
        <rootElementLocalName>sect3</rootElementLocalName>
        <dtdPublicId substring="true">DTD DocBook XML</dtdPublicId>
        <dtdPublicId substring="true">DTD DocBook EBNF</dtdPublicId>
       </or>
       <rootElementNamespace xsi:nil="true" />
       <not>
         <dtdPublicId substring="true">Simplified</dtdPublicId>
       </not>
     </and>
   </detect>

   <dtd publicId="-//OASIS//DTD DocBook XML V4.2//EN"
        systemId="dtd/V4.2/docbookx.dtd" />
---

<detect> element detects, for example, a DTD-less section as being DocBook.

<dtd> element associates local, modified, docbookx.dtd to the DTD-less 
section.

In summary, the quickest way to solve your problem is to modify your 
manual page using a text editor and change your <!DOCTYPE> to
---
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
   "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd";>
---

Note that:
---
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
   "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd";>
---
will work too.



Reply via email to