From b14ad898bf84b5ebffb8e1af41079f65554d4dc5 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jos=C3=A9=20Matox?= Date: Thu, 13 May 2004 11:21:58 +0000 Subject: [PATCH] add support for xml, now just for docbook git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@8751 a592a061-630c-0410-9148-cb99ea01b6c8 --- lib/ChangeLog | 4 ++++ lib/configure.m4 | 2 ++ src/ChangeLog | 7 +++++++ src/buffer.C | 8 +++++++- src/converter.C | 6 +++++- src/converter.h | 2 ++ src/outputparams.h | 3 ++- 7 files changed, 29 insertions(+), 3 deletions(-) diff --git a/lib/ChangeLog b/lib/ChangeLog index 66054605c6..c15f69f51c 100644 --- a/lib/ChangeLog +++ b/lib/ChangeLog @@ -1,3 +1,7 @@ +2004-05-13 José Matos + + * configure.m4: add support for docbook-xml. + 2004-05-12 José Matos * layouts/db_stdclass.inc: do not use small caps for name. diff --git a/lib/configure.m4 b/lib/configure.m4 index 43d5810313..7b5888a922 100644 --- a/lib/configure.m4 +++ b/lib/configure.m4 @@ -521,6 +521,7 @@ cat >$outfile <$outfile < \$\$o" "" +\\converter docbook docbook-xml "cp \$\$i \$\$o" "xml" \\converter docbook dvi "$docbook_to_dvi_command" "" \\converter docbook html "$docbook_to_html_command" "" \\converter dvi pdf3 "$dvi_to_pdf_command" "" diff --git a/src/ChangeLog b/src/ChangeLog index e91d34ea25..e5c9c3db69 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,10 @@ +2004-05-13 José Matos + + * converter.h: + * converter.C (Converter, readFlags): add xml member. + * outputparams.h: add XML flavor. + * buffer.C (makeDocBookFile): add support for the sgml/xml distinction. + 2004-05-03 Jean-Marc Lasgouttes * lyxfunc.C (dispatch): diff --git a/src/buffer.C b/src/buffer.C index 054c7f0659..5b84c17147 100644 --- a/src/buffer.C +++ b/src/buffer.C @@ -20,6 +20,7 @@ #include "Bullet.h" #include "Chktex.h" #include "debug.h" +#include "encoding.h" #include "errorlist.h" #include "exporter.h" #include "format.h" @@ -1065,6 +1066,10 @@ void Buffer::makeDocBookFile(string const & fname, string top_element = tclass.latexname(); if (!only_body) { + if (runparams.flavor == OutputParams::XML) + ofs << "encoding()->Name() << "\"?>\n"; + ofs << subst(tclass.class_header(), "#", top_element); string preamble = params().preamble; @@ -1090,7 +1095,8 @@ void Buffer::makeDocBookFile(string const & fname, } sgml::openTag(ofs, 0, false, top); - ofs << "\n"; params().getLyXTextClass().counters().reset(); diff --git a/src/converter.C b/src/converter.C index 038738cbf1..10ebfeaf7b 100644 --- a/src/converter.C +++ b/src/converter.C @@ -104,7 +104,7 @@ private: Converter::Converter(string const & f, string const & t, string const & c, string const & l): from(f), to(t), command(c), flags(l), - From(0), To(0), latex(false), + From(0), To(0), latex(false), xml(false), original_dir(false), need_aux(false) {} @@ -118,6 +118,8 @@ void Converter::readFlags() flag_value = split(flag_value, flag_name, '='); if (flag_name == "latex") latex = true; + else if (flag_name == "xml") + xml = true; else if (flag_name == "originaldir") original_dir = true; else if (flag_name == "needaux") @@ -264,6 +266,8 @@ OutputParams::FLAVOR Converters::getFlavor(Graph::EdgePath const & path) if (conv.latex) if (contains(conv.to, "pdf")) return OutputParams::PDFLATEX; + if (conv.xml) + return OutputParams::XML; } return OutputParams::LATEX; } diff --git a/src/converter.h b/src/converter.h index 6775fb0f1a..3945dd5c3b 100644 --- a/src/converter.h +++ b/src/converter.h @@ -48,6 +48,8 @@ public: /// The converter is latex or its derivatives bool latex; + /// The converter is xml + bool xml; /// Do we need to run the converter in the original directory? bool original_dir; /// This converter needs the .aux files diff --git a/src/outputparams.h b/src/outputparams.h index 8071f2454e..6bbe7a181c 100644 --- a/src/outputparams.h +++ b/src/outputparams.h @@ -19,7 +19,8 @@ struct OutputParams { // enum FLAVOR { LATEX, - PDFLATEX + PDFLATEX, + XML }; OutputParams() -- 2.39.2