#include "support/path.h"
#include "support/textutils.h"
#include "support/tostr.h"
-#include "support/std_sstream.h"
#include <boost/bind.hpp>
+#include <utime.h>
+
#include <iomanip>
#include <stack>
+#include <sstream>
-#include <utime.h>
using lyx::pos_type;
using lyx::par_type;
namespace {
-const int LYX_FORMAT = 234;
+const int LYX_FORMAT = 235;
} // namespace anon
ofs << "<?xml version=\"1.0\" encoding=\""
<< params().language->encoding()->Name() << "\"?>\n";
- ofs << subst(tclass.class_header(), "#", top_element);
+ ofs << "<!DOCTYPE " << top_element << " ";
+
+ if (! tclass.class_header().empty()) ofs << tclass.class_header();
+ else if (runparams.flavor == OutputParams::XML)
+ ofs << "PUBLIC \"-//OASIS//DTD DocBook XML//EN\" "
+ << "\"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd\"";
+ else
+ ofs << " PUBLIC \"-//OASIS//DTD DocBook V4.2//EN\"";
string preamble = params().preamble;
string const name = runparams.nice ? ChangeExtension(pimpl_->filename, ".sgml")
string top = top_element;
top += " lang=\"";
- top += params().language->code();
+ if (runparams.flavor == OutputParams::XML)
+ top += params().language->code();
+ else
+ top += params().language->code().substr(0,2);
top += '"';
if (!params().options.empty()) {