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
This commit is contained in:
José Matox 2004-05-13 11:21:58 +00:00
parent 5a87b2a21c
commit b14ad898bf
7 changed files with 29 additions and 3 deletions

View File

@ -1,3 +1,7 @@
2004-05-13 José Matos <jamatos@lyx.org>
* configure.m4: add support for docbook-xml.
2004-05-12 José Matos <jamatos@lyx.org>
* layouts/db_stdclass.inc: do not use small caps for name.

View File

@ -521,6 +521,7 @@ cat >$outfile <<EOF
\\Format date "" "date command" "" "" ""
\\Format dateout tmp "date (output)" "" "" ""
\\Format docbook sgml DocBook B "" ""
\\Format docbook-xml xml "Docbook (xml)" "" "" ""
\\Format dvi dvi DVI D "$DVI_VIEWER" ""
\\Format eps eps EPS "" "$EPS_VIEWER" ""
\\Format fax "" Fax "" "" ""
@ -554,6 +555,7 @@ cat >$outfile <<EOF
\\Format xpm xpm XPM "" "$RASTERIMAGE_VIEWER" "$RASTERIMAGE_EDITOR"
\\converter date dateout "date +%d-%m-%Y > \$\$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" ""

View File

@ -1,3 +1,10 @@
2004-05-13 José Matos <jamatos@lyx.org>
* 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 <lasgouttes@lyx.org>
* lyxfunc.C (dispatch):

View File

@ -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 << "<?xml version=\"1.0\" encoding=\""
<< params().language->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 << "<!-- SGML/XML file was created by LyX " << lyx_version
ofs << "<!-- " << ((runparams.flavor == OutputParams::XML)? "XML" : "SGML")
<< " file was created by LyX " << lyx_version
<< "\n See http://www.lyx.org/ for more information -->\n";
params().getLyXTextClass().counters().reset();

View File

@ -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;
}

View File

@ -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

View File

@ -19,7 +19,8 @@ struct OutputParams {
//
enum FLAVOR {
LATEX,
PDFLATEX
PDFLATEX,
XML
};
OutputParams()