Re: [Refdb-users] xhtml references don't start on new line
Status: Beta
Brought to you by:
mhoenicka
|
From: David N. <dav...@bi...> - 2004-03-11 11:26:15
|
Hi Markus, >I'm afraid this may be a display problem of your browser. The output >looks just fine over here (Firebird 0.7 on FreeBSD). > =20 > Problem is visible on both: Firefox version 0.8-3 (Mozilla 1.6, Copyright (c) 2003 mozilla.org,=20 build 2004022702) and Firebird version 0.7-7 (Mozilla 1.5, Copyright (c) 2003 mozilla.org=20 <developer build>), running on Debian Sarge/testing (these are the current versions in testin= g). I don't have Netscape installed. KDE 's browser, Konqueror, wouldn't render the file. The KHTML=20 rendering engine threw a parsing error on the Revision History table,=20 objecting to the <tr> element following the <table> element. Perhaps it=20 wanted <tr> inside the <th> element? If you trick lynx into rendering XHTML as HTML (see=20 <http://www.kolpackov.net/projects/LynxAndXHTML.xhtml>), it renders=20 correctly, but I'm not sure of the significance of this. Here is the source xml document: .........................................................................= ................................................................. <?xml version=3D"1.0"?> <!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"=20 "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [ <!ENTITY bibliography SYSTEM "reftoc.bib.xml"> ]> <article> <title>TOC Reference List tester</title> <articleinfo> <author> <surname>Nebauer</surname> <firstname>David</firstname> <affiliation> <address> <email>dav...@bi...</email> </address> </affiliation> </author> <revhistory> <revision> <revnumber>1</revnumber> <date>2004-03-03</date> <authorinitials>DN</authorinitials> <revremark>Create document</revremark> </revision> </revhistory> </articleinfo> <!-- <abstract> <para>Demonstration of the “missing TOC entry”=20 phenomenon.</para> </abstract> --> <section id=3D"spurious-quotes"> <title>Some quotes</title> <para>In order to interest refdb in my document, I have to make=20 some quotes, such as <citation role=3D"REFDB">Savitch2001</citation> and=20 <citation role=3D"REFDB">Lamport1994</citation>, for it to work on. That= =20 should suffice.</para> </section> <section id=3D"problem-statement"> <title>Statement of the problem</title> <para>Some weeks ago I decided to plunge headlong into DocBook=20 XML. With no prior experience I immersed myself in XSLT processors, FO=20 processors, XML, the DocBook specifications, catalogs (argh!) and,=20 finally, refdb. As I proceeded I had a test document which steadily=20 grew in complexity. When I reached the point of being able to ouptut=20 pdf, I noticed something strange about the Table of Contents.</para> <para>What I noticed was that there was an entry at the correct=20 place. It gave page number and leader dots. What was absent, however,=20 were the words “Reference List” at the start of the entry. =20 I notified <emphasis>refdb-users</emphasis> and continued. My test=20 document grew increasingly more complex as I learned more. Then I saw=20 an amazing thing. The entry had corrected itself! Yes, there was a=20 pristine Table of Contents entry right where it should have been all=20 along.</para> <para>My current working theory is that it wil be absent in=20 simple documents. This doument is a test of that theory. So, here goes=20 …</para> </section> &bibliography; </article> .........................................................................= .............................................................. Here are the references to which it refers: .........................................................................= .............................................................. $ refdbc -C "getref -t risx :ID:<3" <?xml version=3D"1.0" encoding=3D"ISO-8859-1"?> <!DOCTYPE ris PUBLIC "-//Markus Hoenicka//DTD Ris V1.0.2//EN"=20 "http://refdb.sourceforge.net/dtd/risx-1.0.2/risx.dtd" [ <!ENTITY lt "&#60;"> <!ENTITY gt ">"> <!ENTITY amp "&#38;"> ]> <ris> <entry type=3D"BOOK" id=3D"1" citekey=3D"Lamport1994"> <publication> <title type=3D"gen">LaTeX: A Document Preparation System</title> <author> <lastname>Lamport</lastname> <firstname>Leslie</firstname> </author> <pubinfo> <pubdate type=3D"primary"> <date><year>1994</year><month>00</month><day>00</day></date> </pubdate> <city>Massachusetts</city> <publisher>Addison-Wesley</publisher> </pubinfo> </publication> <libinfo user=3D"david"> <reprint status=3D"NOTINFILE"/> </libinfo> </entry> <entry type=3D"BOOK" id=3D"2" citekey=3D"Savitch2001"> <publication> <title type=3D"gen">Java. An Introduction to Computer Science and=20 Programming</title> <author> <lastname>Savitch</lastname> <firstname>Walter</firstname> </author> <pubinfo> <pubdate type=3D"primary"> <date><year>2001</year><month>00</month><day>00</day></date> </pubdate> <city>New Jersey</city> <publisher>Prentice Hall</publisher> </pubinfo> </publication> <libinfo user=3D"david"> <reprint status=3D"NOTINFILE"/> </libinfo> </entry> </ris> 2 reference(s) retrieved .........................................................................= .............................................................. Here is the transformation command: refdbxml -s=20 Eur.J.Pharmacol.xhtml.xsl -t xhtml reftoc.xml Note: XSLT processor =3D xsltproc. Here is the resulting xhtml file: .........................................................................= .............................................................. $ cat reftoc.xhtml <?xml version=3D"1.0" encoding=3D"UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"=20 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns=3D"http://www.w3.org/1999/xhtml"><head><meta=20 http-equiv=3D"Content-Type" content=3D"text/html; charset=3DUTF-8"=20 /><title>TOC Reference List tester</title><meta name=3D"generator"=20 content=3D"DocBook XSL Stylesheets V1.64.1" /></head><body><div=20 class=3D"article" lang=3D"en" xml:lang=3D"en"><div=20 class=3D"titlepage"><div><div><h2 class=3D"title"><a id=3D"id2403246"></a= >TOC=20 Reference List tester</h2></div><div><div class=3D"author"><h3=20 class=3D"author"><span class=3D"firstname">David</span> <span=20 class=3D"surname">Nebauer</span></h3><div class=3D"affiliation"><div=20 class=3D"address"><p><br /> <tt class=3D"email"><<a=20 href=3D"mailto:dav...@bi...">dav...@bi...</a>>= </tt><br=20 /> </p></div></div></div></div><div><div=20 class=3D"revhistory"><table border=3D"1" width=3D"100%" summary=3D"Revisi= on=20 history"><tr><th align=3D"left" valign=3D"top" colspan=3D"3"><b>Revision=20 History</b></th></tr><tr><td align=3D"left">Revision 1</td><td=20 align=3D"left">2004-03-03</td><td align=3D"left">DN</td></tr><tr><td=20 align=3D"left" colspan=3D"3">Create=20 document</td></tr></table></div></div></div><div></div><hr /></div><div=20 class=3D"toc"><p><b>Table of Contents</b></p><dl><dt><span=20 class=3D"section"><a href=3D"#spurious-quotes">Some=20 quotes</a></span></dt><dt><span class=3D"section"><a=20 href=3D"#problem-statement">Statement of the=20 problem</a></span></dt><dt><span class=3D"bibliography"><a=20 href=3D"#id2502984">Reference List</a></span></dt></dl></div><div=20 class=3D"section" lang=3D"en" xml:lang=3D"en"><div=20 class=3D"titlepage"><div><div><h2 class=3D"title" style=3D"clear: both"><= a=20 id=3D"spurious-quotes"></a>Some=20 quotes</h2></div></div><div></div></div><p>In order to interest refdb in=20 my document, I have to make some quotes, such as <a xmlns=3D""=20 href=3D"#IDSavitch2001">(Savitch, 2001)</a> and <a xmlns=3D""=20 href=3D"#IDLamport1994">(Lamport, 1994)</a>, for it to work on. That=20 should suffice.</p></div><div class=3D"section" lang=3D"en"=20 xml:lang=3D"en"><div class=3D"titlepage"><div><div><h2 class=3D"title"=20 style=3D"clear: both"><a id=3D"problem-statement"></a>Statement of the=20 problem</h2></div></div><div></div></div><p>Some weeks ago I decided to=20 plunge headlong into DocBook XML. With no prior experience I immersed=20 myself in XSLT processors, FO processors, XML, the DocBook=20 specifications, catalogs (argh!) and, finally, refdb. As I proceeded I=20 had a test document which steadily grew in complexity. When I reached=20 the point of being able to ouptut pdf, I noticed something strange about=20 the Table of Contents.</p><p>What I noticed was that there was an entry=20 at the correct place. It gave page number and leader dots. What was=20 absent, however, were the words =E2Reference List=E2 at the start of the=20 entry. I notified <span class=3D"emphasis"><em>refdb-users</em></span>=20 and continued. My test document grew increasingly more complex as I=20 learned more. Then I saw an amazing thing. The entry had corrected=20 itself! Yes, there was a pristine Table of Contents entry right where=20 it should have been all along.</p><p>My current working theory is that=20 it wil be absent in simple documents. This doument is a test of that=20 theory. So, here goes =E2=A6</p></div><div xmlns=3D"" id=3D"id2502984"=20 class=3D"bibliography"><div xmlns=3D"http://www.w3.org/1999/xhtml"=20 class=3D"titlepage"><div><div><h2 class=3D"title"><a=20 id=3D"id2502984"></a>Reference=20 List</h2></div></div><div></div></div><p><div id=3D"IDLamport1994"=20 class=3D"bibliomixed">Lamport L., 1994, LaTeX: A Document Preparation=20 System (Addison-Wesley, Massachusetts) </div></p><p><div=20 id=3D"IDSavitch2001" class=3D"bibliomixed">Savitch W., 2001, Java. An=20 Introduction to Computer Science and Programming (Prentice Hall, New=20 Jersey) </div></p><p><div id=3D"id2563143"=20 class=3D"bibliomixed"></div></p></div></div></body></html> .........................................................................= .............................................................. That's almost impossible to parse with the naked eye. So, here is the=20 last part (the bibliography) in formatted form: .........................................................................= .............................................................. <... elision ...> <div xmlns=3D"" id=3D"id2502984" class=3D"bibliography"> <div xmlns=3D"http://www.w3.org/1999/xhtml" class=3D"titl= epage"> <div> <div> <h2 class=3D"title"><a=20 id=3D"id2502984"></a>Reference List</h2> </div> </div> <div></div> </div> <p> <div id=3D"IDLamport1994" class=3D"bibliomixed"> Lamport L., 1994, LaTeX: A Document Preparation=20 System (Addison-Wesley, Massachusetts) </div> </p> <p> <div id=3D"IDSavitch2001" class=3D"bibliomixed"> Savitch W., 2001, Java. An Introduction to=20 Computer Science and Programming (Prentice Hall, New Jersey) </div> </p> <p> <div id=3D"id2563143" class=3D"bibliomixed"></div> </p> </div> </div> </body> </html> .........................................................................= .............................................................. It seems correct to me: each bibliography entry is enclosed in both=20 <p></p> and <div></div> elements. Unless other eyes have spotted=20 something, I'm forced to agree this is a bug in the latest firebird and=20 firefox browsers on Debian. Still, seems unusual that the remainder of=20 the document displays correctly. Markus, perhaps you'd care to cut and=20 paste the xhtml into a file and see whether it renders correctly in your=20 browser? As a final step I'll update to the latest CVS refdb and see if that has=20 any effect (shouldn't, since the bug appears to be in the browsers). Regards, David. |