On Thu, Nov 07, 2002 at 03:16:18PM +0000, Jos? Fonseca wrote:
> BTW, I've already discovered the problem with the docbook output
> reported in
> http://mail.gnu.org/pipermail/bug-texinfo/2002-September/005283.html .
> It seems that the code 'xml_insert_element (BOOKINFO, START);' in
> xml.c:827 is being called inside execute_string, but 'xml_insert_element
> (ABSTRACT, END);' in xml.c:714 is not  (I can show you the stack back
> traces of this). By some reason in some texinfo documents (such as the
> autoconf-2.53a manual) the expanded abstract is printed twice causing
> unbalanced BOOKINFO/ABSTRACT tags. I still haven't the time to figure
> out the best way to fix this though.

Ok. This only happens with documents which have '@set copying' before
the first node and then a '@insertcopying' after. The code that opens
the BOOKINFO and ABSTRACT flag assumes that it's being output'ed to the
output file, but within '@set/@end copying' it's not the case. My patch
attached makes it verify that it's not inside 'execute_string' and
actually outputing.

This should have no secondary effect, but it's actually hard to tell -
the worst it could happen (in DocBook only) is regular text being
output'd before a node without being inside the ABSTRACT tag, which may
even be accepted by the DocBook DTD.

The fact is that at this point only 4 out of 37 texinfo generated XML
docbooks (including huge stuff such as glibc and gcc) have bad XML
syntax.

Jos� Fonseca
Index: xml.c
===================================================================
RCS file: /cvsroot/texinfo/texinfo/makeinfo/xml.c,v
retrieving revision 1.4
diff -u -r1.4 xml.c
--- xml.c       7 Nov 2002 22:14:56 -0000       1.4
+++ xml.c       7 Nov 2002 22:42:05 -0000
@@ -821,7 +821,7 @@
   if (docbook && !only_macro_expansion && (in_menu || in_detailmenu))
     return;
 
-  if (!first_section_opened && !in_abstract && xml_current_element () == TEXINFO
+  if (!executing_string && !first_section_opened && !in_abstract && 
+xml_current_element () == TEXINFO
       && !xml_no_para && character != '\r' && character != '\n' && character != ' ')
     {
       xml_insert_element (BOOKINFO, START);

Reply via email to