]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/InsetMathRef.cpp
Revert "XHTML: remove DOCTYPE, as the document is then understood as HTML4/XHTML1...
[lyx.git] / src / mathed / InsetMathRef.cpp
index 3e1bc0290ae93e4885de32ff02b0cb73a135a32e..99058d776f2a2668691e4b2af1388736ee981b7d 100644 (file)
@@ -182,24 +182,18 @@ void InsetMathRef::validate(LaTeXFeatures & features) const
 }
 
 
-int InsetMathRef::docbook(odocstream & os, OutputParams const & runparams) const
+void InsetMathRef::docbook(XMLStream & xs, OutputParams const &) const
 {
        if (cell(1).empty()) {
-               os << "<xref linkend=\""
-                  << xml::cleanID(asString(cell(0)));
-               if (runparams.flavor == OutputParams::DOCBOOK5)
-                       os << "\"/>";
-               else
-                       os << "\">";
+               docstring attr = from_utf8("linkend=\"") + xml::cleanID(asString(cell(0))) + from_utf8("\"");
+               xs << xml::CompTag("xref", to_utf8(attr));
        } else {
-               os << "<link linkend=\""
-                  << xml::cleanID(asString(cell(0)))
-                  << "\">"
+               // Link with linkend, as is it within the document (not outside, in which case xlink:href is better suited).
+               docstring attr = from_utf8("linkend=\"") + xml::cleanID(asString(cell(0))) + from_utf8("\"");
+               xs << xml::StartTag("link", to_utf8(attr))
                   << asString(cell(1))
-                  << "</link>";
+                  << xml::EndTag("link");
        }
-
-       return 0;
 }