add awareness of the sgml/xml distinction for math output in docbook

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@8896 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
José Matox 2004-08-13 11:00:34 +00:00
parent 3d3fdcf032
commit b241721780
2 changed files with 25 additions and 12 deletions

View File

@ -1,4 +1,7 @@
2004-08-13 José Matos <jamatos@lyx.org>
* math_hullinset.C (docbook): add awareness of the distinction
between the sgml and xml versions of docbook.
2004-08-12 André Pönitz <poenitz@gmx.net> 2004-08-12 André Pönitz <poenitz@gmx.net>

View File

@ -1263,17 +1263,27 @@ int MathHullInset::docbook(Buffer const & buf, ostream & os,
OutputParams const & runparams) const OutputParams const & runparams) const
{ {
MathMLStream ms(os); MathMLStream ms(os);
string name="equation"; int res = 0;
if (! label(0).empty()) name += " id=\"" + label(0)+ "\""; string name;
ms << MTag(name.c_str()); if (getType() == "simple")
ms << MTag("alt"); name= "inlineequation";
ms << "<[CDATA["; else
int res = plaintext(buf, ms.os(), runparams); name = "informalequation";
ms << "]]>";
ms << ETag("alt"); string bname = name;
if (! label(0).empty()) bname += " id=\"" + label(0)+ "\"";
ms << MTag(bname.c_str());
if (runparams.flavor == OutputParams::XML) {
ms << MTag("math"); ms << MTag("math");
MathGridInset::mathmlize(ms); MathGridInset::mathmlize(ms);
ms << ETag("math"); ms << ETag("math");
ms << ETag("equation"); } else {
ms << MTag("alt");
res = latex(buf, ms.os(), runparams);
ms << ETag("alt");
}
ms << ETag(name.c_str());
return ms.line() + res; return ms.line() + res;
} }