bug-texinfo
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

invalid doctype/xml


From: Jens Elkner
Subject: invalid doctype/xml
Date: Tue, 25 Nov 2003 04:19:33 +0100 (MET)

Hi,

unfortunately makeinfo --docbook produces wrong xml code:

1) wrong DOCTYPE line
if a root element is followed by an PUBLIC identifier, a system identifier
must follow - see http://www.w3.org/TR/REC-xml#sec-prolog-dtd!

2) <colspec ...> 
colspec elements have never an end tag -> invalid xml

3) <xref ...>
xref elements have never an end tag -> invalid xml

4)
if @documentencoding ISO-8859-1 is use and enabled, makeinfo produces
invalid xml code by appending \^_ ...
Instead of that, makeinfo should insert 
<?xml version="1.0" encoding="enc"?>
at the top of the document!


I suggest for 1) and 2) the following fix:
---schnipp---
--- texinfo-4.6/makeinfo/xml.c.orig     Tue May 13 18:37:54 2003
+++ texinfo-4.6/makeinfo/xml.c  Mon Nov 24 02:04:24 2003
@@ -439,7 +439,7 @@
   book_started = 1;
   if (docbook)
     {
-      insert_string ("<!DOCTYPE Book PUBLIC \"-//OASIS//DTD DocBook 
V3.1//EN\">");
+      insert_string ("<!DOCTYPE Book PUBLIC \"-//OASIS//DTD DocBook XML 
V4.2//EN\" \"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd\";>");
       xml_element_list = docbook_element_list;
     }
   else
@@ -1453,7 +1453,7 @@
       for (i=0; i<ncolumns; i++)
         {
           xml_insert_element_with_attribute (COLSPEC, START, 
"colwidth=\"%d*\"", column_widths[i]);
-          xml_pop_current_element ();
+          xml_insert_element (COLSPEC, END);
         }
       xml_insert_element (TBODY, START);
       xml_no_para = 1;
--schnapp---

With this fix, one has also no problems to resolve the public as well as
the system identifier via xml catalogs locally.


Last but not least: RFE wrt. to mapping texinfo commands and to retain as
as much information as possible:
=========================================================
a) map @comment to <!-- ... --> instead of ignoring it entirly
b) man @env to <env>...</env> instead of <command>...</command>
c) map @example to <example>...</example> instead of <screen>...</screen>
d) map @file to <filename>...</filename> instead of <command>...</command>
e) map @option to <option>...</option> instead of <command>...</command>
f) map @samp to <userinput>...</userinput> instead of <command>...</command>

With the current mapping a lot of information gets lost at least wrt.
and one is unable to extract required information or adjust the view
(e.g. color when transforming the docbook into [x]html or pdf) 

Since html does not really provide similar tags, it would probably
a good idea to use <code class="$texinfo_tag">...</code>.

BTW: Are there any hints/tips, how makeinfo works out the appropriate tags?
I took a quick look at cmds.* and xml.c, however the cm_$something and 
the arrays are a little bit too confusing for me to provide an appropriate
patch :(

Regards,
jens.
-- 
+---[ Jens Elkner ]---------[ IMS GmbH, Abt. Server/Netzwerkmanagement ]--+
| Sandtorstr. 23                       +49 391 54486 19230                |
| 39106 Magdeburg                       address@hidden                |
| GERMANY                             http://www.imsgroup.de/             |
+-------------------------------------------------------------------------+




reply via email to

[Prev in Thread] Current Thread [Next in Thread]