On Wednesday 10 April 2013 22:05:09 Scott Kostyshak wrote:
> I tried to test docbook_article with db2pdf and I get errors. Here are a few:
> 
> openjade:/tmp/lyx_tmpdir.n10355/lyx_tmpbuf2/docbook_article.sgml:113:68:E:
> element "DUMMY" undefined
> openjade:/tmp/lyx_tmpdir.n10355/lyx_tmpbuf2/docbook_article.sgml:114:6:E:
> element "DUMMY" undefined
> openjade:/tmp/lyx_tmpdir.n10355/lyx_tmpbuf2/docbook_article.sgml:114:83:E:
> end tag for "FOOTNOTE" which is not finished
> openjade:/tmp/lyx_tmpdir.n10355/lyx_tmpbuf2/docbook_article.sgml:121:89:E:
> element "DUMMY" undefined
> openjade:/tmp/lyx_tmpdir.n10355/lyx_tmpbuf2/docbook_article.sgml:121:169:E:
> end tag for "FOOTNOTE" which is not finished
> support/Systemcall.cpp (277): Systemcall: 'db2pdf
> "docbook_article.sgml"' finished with exit code 8
> Error: Cannot convert file
> ----------------------------------------
> An error occurred while running:
> db2pdf "docbook_article.sgml"
> 
> Note that I can export docbook_article with sgmltools.
> 
> Does db2pdf work for you?

I have different errors since I only have docbook 4.5 installed.

The patch attached fixes the first problem you describe the "DUMMY" references 
(pun intended). :-D

I will try to chase and fix the others.

Regards,
-- 
José Abílio
diff --git a/src/sgml.cpp b/src/sgml.cpp
index 9854784..4842b07 100644
--- a/src/sgml.cpp
+++ b/src/sgml.cpp
@@ -181,7 +181,12 @@ void sgml::openTag(odocstream & os, string const & name, string const & attribut
 	string param = subst(attribute, "<", "\"");
 	param = subst(param, ">", "\"");
 
-	if (!name.empty() && name != "!-- --") {
+	// Note: we ignore the name if it empty or if it is a comment "<!-- -->" or
+	// if the name is *dummy*.
+	// We ignore dummy because dummy is not a valid docbook element and it is
+	// the internal name given to single paragraphs in the latex output.
+	// This allow us to simplify the code a lot and is a reasonable compromise.
+	if (!name.empty() && name != "!-- --" && name != "dummy") {
 		os << '<' << from_ascii(name);
 		if (!param.empty())
 			os << ' ' << from_ascii(param);
@@ -192,7 +197,7 @@ void sgml::openTag(odocstream & os, string const & name, string const & attribut
 
 void sgml::closeTag(odocstream & os, string const & name)
 {
-	if (!name.empty() && name != "!-- --")
+	if (!name.empty() && name != "!-- --" && name != "dummy")
 		os << "</" << from_ascii(name) << '>';
 }
 

Reply via email to