- // FIXME This does not work, we need to define the entries here.
- //os << "<glossary><glossary/>";
- return 0;
+ os << "<glossary>\n";
+ int newlines = 2;
+ for (InsetIterator it = inset_iterator_begin(buf.inset()); it;) {
+ if (it->lyxCode() == InsetBase::NOMENCL_CODE) {
+ newlines += static_cast<InsetNomencl const &>(*it).docbookGlossary(os);
+ ++it;
+ } else if(it->lyxCode() == InsetBase::NOTE_CODE &&
+ static_cast<InsetNote const &>(*it).params().type == InsetNoteParams::Note) {
+ // Don't output anything nested in note insets
+ size_t const depth = it.depth();
+ ++it;
+ while (it.depth() > depth)
+ ++it;
+ } else {
+ ++it;
+ }
+ }
+ os << "</glossary>\n";
+ return newlines;