#include "FuncStatus.h"
#include "LaTeXFeatures.h"
#include "output_xhtml.h"
+#include "output_docbook.h"
#include "ParIterator.h"
#include "texstream.h"
#include "TocBackend.h"
return content;
// we have to do the escaping here, because we will ultimately
// write this as a raw string, so as not to escape the tags.
- return "<a href='#LyXCite-" + html::cleanAttr(key) + "'>" +
- html::htmlize(content, XHTMLStream::ESCAPE_ALL) + "</a>";
+ return "<a href='#LyXCite-" + xml::cleanAttr(key) + "'>" +
+ xml::escapeString(content, XMLStream::ESCAPE_ALL) + "</a>";
}
} // anonymous namespace
// we need to give the other defaults, too, to set it.
vector<docstring> keys =
getVectorFromString(key, from_ascii(","), false, false);
- for (auto k : keys) {
+ for (auto const & k : keys) {
if (biblist.find(k) == biblist.end()) {
setBroken(true);
break;
}
-int InsetCitation::docbook(odocstream & os, OutputParams const &) const
+void InsetCitation::docbook(XMLStream & xs, OutputParams const &) const
{
- os << from_ascii("<citation>")
- << cleanupWhitespace(getParam("key"))
- << from_ascii("</citation>");
- return 0;
+ if (getCmdName() == "nocite")
+ return;
+
+ // Split the different citations (on ","), so that one tag can be output for each of them.
+ // DocBook does not support having multiple citations in one tag, so that we have to deal with formatting here.
+ docstring citations = getParam("key");
+ if (citations.find(',') == string::npos) {
+ xs << xml::CompTag("biblioref", "endterm=\"" + to_utf8(xml::cleanID(citations)) + "\"");
+ } else {
+ size_t pos = 0;
+ while (pos != string::npos) {
+ pos = citations.find(',');
+ xs << xml::CompTag("biblioref", "endterm=\"" + to_utf8(xml::cleanID(citations.substr(0, pos))) + "\"");
+ citations.erase(0, pos + 1);
+
+ if (pos != string::npos) {
+ xs << ", ";
+ }
+ }
+ }
}
-docstring InsetCitation::xhtml(XHTMLStream & xs, OutputParams const &) const
+docstring InsetCitation::xhtml(XMLStream & xs, OutputParams const &) const
{
- string const & cmd = getCmdName();
- if (cmd == "nocite")
+ if (getCmdName() == "nocite")
return docstring();
// have to output this raw, because generateLabel() will include tags
- xs << XHTMLStream::ESCAPE_NONE << generateLabel(true);
+ xs << XMLStream::ESCAPE_NONE << generateLabel(true);
return docstring();
}
// engine, e.g. \cite[]{} for the basic engine.
void InsetCitation::latex(otexstream & os, OutputParams const & runparams) const
{
- // When this is a child compiled on its own, we use the childs
+ // When this is a child compiled on its own, we use the children
// own bibinfo, else the master's
BiblioInfo const & bi = runparams.is_child
? buffer().masterBibInfo() : buffer().bibInfo();
// check if we have to do a qualified list
vector<docstring> keys = getVectorFromString(cleanupWhitespace(key));
bool const qualified = cs.hasQualifiedList
- && (!getParam("pretextlist").empty()
+ && (!getParam("F").empty()
|| !getParam("posttextlist").empty());
if (runparams.inulemcmd > 0)