]> git.lyx.org Git - features.git/blobdiff - src/buffer.C
change "support/std_sstream.h" to <sstream>
[features.git] / src / buffer.C
index a1ae1f6f481691d9fb82c79eadc871f24b57343e..d6665c8352d1bcf3ea059cf830809a6defd79634 100644 (file)
 #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;
@@ -136,7 +137,7 @@ extern BufferList bufferlist;
 
 namespace {
 
-const int LYX_FORMAT = 234;
+const int LYX_FORMAT = 235;
 
 } // namespace anon
 
@@ -1070,7 +1071,14 @@ void Buffer::makeDocBookFile(string const & fname,
                        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")
@@ -1086,7 +1094,10 @@ void Buffer::makeDocBookFile(string const & fname,
 
        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()) {