Skip to content

Commit 308acdb

Browse files
committed
Adding engine to xml output for plantuml
For the output HTML / LaTeX / RTF / docbook the `\startuml` command has been extended with the "engine". This was omitted with XML - added engine for `<plantuml>` tag in the XML output - made some attribute testing rules a bit more precise.
1 parent 09fb676 commit 308acdb

File tree

2 files changed

+64
-14
lines changed

2 files changed

+64
-14
lines changed

src/xmldocvisitor.cpp

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ static void visitCaption(XmlDocVisitor *parent, const DocNodeList &children)
3838
static void visitPreStart(TextStream &t, const char *cmd, bool doCaption,
3939
XmlDocVisitor *parent, const DocNodeList &children,
4040
const QCString &name, bool writeType, DocImage::Type type, const QCString &width,
41-
const QCString &height, const QCString &alt = QCString(""), bool inlineImage = FALSE)
41+
const QCString &height, const QCString engine, const QCString &alt = QCString(""), bool inlineImage = FALSE)
4242
{
4343
t << "<" << cmd;
4444
if (writeType)
@@ -66,6 +66,10 @@ static void visitPreStart(TextStream &t, const char *cmd, bool doCaption,
6666
{
6767
t << " height=\"" << convertToXML(height) << "\"";
6868
}
69+
if (!engine.isEmpty())
70+
{
71+
t << " engine=\"" << convertToXML(engine) << "\"";
72+
}
6973
if (!alt.isEmpty())
7074
{
7175
t << " alt=\"" << convertToXML(alt) << "\"";
@@ -300,17 +304,17 @@ void XmlDocVisitor::visit(DocVerbatim *s)
300304
m_t << s->text();
301305
break;
302306
case DocVerbatim::Dot:
303-
visitPreStart(m_t, "dot", s->hasCaption(), this, s->children(), QCString(""), FALSE, DocImage::Html, s->width(), s->height());
307+
visitPreStart(m_t, "dot", s->hasCaption(), this, s->children(), QCString(""), FALSE, DocImage::Html, s->width(), s->height(), QCString());
304308
filter(s->text());
305309
visitPostEnd(m_t, "dot");
306310
break;
307311
case DocVerbatim::Msc:
308-
visitPreStart(m_t, "msc", s->hasCaption(), this, s->children(), QCString(""), FALSE, DocImage::Html, s->width(), s->height());
312+
visitPreStart(m_t, "msc", s->hasCaption(), this, s->children(), QCString(""), FALSE, DocImage::Html, s->width(), s->height(), QCString());
309313
filter(s->text());
310314
visitPostEnd(m_t, "msc");
311315
break;
312316
case DocVerbatim::PlantUML:
313-
visitPreStart(m_t, "plantuml", s->hasCaption(), this, s->children(), QCString(""), FALSE, DocImage::Html, s->width(), s->height());
317+
visitPreStart(m_t, "plantuml", s->hasCaption(), this, s->children(), QCString(""), FALSE, DocImage::Html, s->width(), s->height(), s->engine());
314318
filter(s->text());
315319
visitPostEnd(m_t, "plantuml");
316320
break;
@@ -945,7 +949,7 @@ void XmlDocVisitor::visitPre(DocImage *img)
945949
[](const auto &att) { return att.name=="alt"; });
946950
QCString altValue = it!=attribs.end() ? it->value : "";
947951
visitPreStart(m_t, "image", FALSE, this, img->children(), baseName, TRUE,
948-
img->type(), img->width(), img->height(),
952+
img->type(), img->width(), img->height(), QCString(),
949953
altValue, img->isInlineImage());
950954

951955
// copy the image to the output dir
@@ -966,7 +970,7 @@ void XmlDocVisitor::visitPost(DocImage *)
966970
void XmlDocVisitor::visitPre(DocDotFile *df)
967971
{
968972
if (m_hide) return;
969-
visitPreStart(m_t, "dotfile", FALSE, this, df->children(), df->file(), FALSE, DocImage::Html, df->width(), df->height());
973+
visitPreStart(m_t, "dotfile", FALSE, this, df->children(), df->file(), FALSE, DocImage::Html, df->width(), df->height(), QCString());
970974
}
971975

972976
void XmlDocVisitor::visitPost(DocDotFile *)
@@ -978,7 +982,7 @@ void XmlDocVisitor::visitPost(DocDotFile *)
978982
void XmlDocVisitor::visitPre(DocMscFile *df)
979983
{
980984
if (m_hide) return;
981-
visitPreStart(m_t, "mscfile", FALSE, this, df->children(), df->file(), FALSE, DocImage::Html, df->width(), df->height());
985+
visitPreStart(m_t, "mscfile", FALSE, this, df->children(), df->file(), FALSE, DocImage::Html, df->width(), df->height(), QCString());
982986
}
983987

984988
void XmlDocVisitor::visitPost(DocMscFile *)
@@ -990,7 +994,7 @@ void XmlDocVisitor::visitPost(DocMscFile *)
990994
void XmlDocVisitor::visitPre(DocDiaFile *df)
991995
{
992996
if (m_hide) return;
993-
visitPreStart(m_t, "diafile", FALSE, this, df->children(), df->file(), FALSE, DocImage::Html, df->width(), df->height());
997+
visitPreStart(m_t, "diafile", FALSE, this, df->children(), df->file(), FALSE, DocImage::Html, df->width(), df->height(), QCString());
994998
}
995999

9961000
void XmlDocVisitor::visitPost(DocDiaFile *)

templates/xml/compound.xsd

Lines changed: 52 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -436,9 +436,9 @@
436436
<xsd:element name="latexonly" type="xsd:string" />
437437
<xsd:element name="docbookonly" type="xsd:string" />
438438
<xsd:element name="image" type="docImageType" />
439-
<xsd:element name="dot" type="docImageType" />
440-
<xsd:element name="msc" type="docImageType" />
441-
<xsd:element name="plantuml" type="docImageType" />
439+
<xsd:element name="dot" type="docDotMscType" />
440+
<xsd:element name="msc" type="docDotMscType" />
441+
<xsd:element name="plantuml" type="docPlantumlType" />
442442
<xsd:element name="anchor" type="docAnchorType" />
443443
<xsd:element name="formula" type="docFormulaType" />
444444
<xsd:element name="ref" type="docRefTextType" />
@@ -467,9 +467,9 @@
467467
<xsd:element name="variablelist" type="docVariableListType" />
468468
<xsd:element name="table" type="docTableType" />
469469
<xsd:element name="heading" type="docHeadingType" />
470-
<xsd:element name="dotfile" type="docImageType" />
471-
<xsd:element name="mscfile" type="docImageType" />
472-
<xsd:element name="diafile" type="docImageType" />
470+
<xsd:element name="dotfile" type="docImageFileType" />
471+
<xsd:element name="mscfile" type="docImageFileType" />
472+
<xsd:element name="diafile" type="docImageFileType" />
473473
<xsd:element name="toclist" type="docTocListType" />
474474
<xsd:element name="language" type="docLanguageType" />
475475
<xsd:element name="parameterlist" type="docParamListType" />
@@ -609,6 +609,30 @@
609609
<xsd:attribute name="caption" type="xsd:string" use="optional"/>
610610
</xsd:complexType>
611611

612+
<xsd:complexType name="docDotMscType" mixed="true">
613+
<xsd:group ref="docTitleCmdGroup" minOccurs="0" maxOccurs="unbounded" />
614+
<xsd:attribute name="name" type="xsd:string" use="optional"/>
615+
<xsd:attribute name="width" type="xsd:string" use="optional"/>
616+
<xsd:attribute name="height" type="xsd:string" use="optional"/>
617+
<xsd:attribute name="caption" type="xsd:string" use="optional"/>
618+
</xsd:complexType>
619+
620+
<xsd:complexType name="docImageFileType" mixed="true">
621+
<xsd:group ref="docTitleCmdGroup" minOccurs="0" maxOccurs="unbounded" />
622+
<xsd:attribute name="name" type="xsd:string" use="optional"/>
623+
<xsd:attribute name="width" type="xsd:string" use="optional"/>
624+
<xsd:attribute name="height" type="xsd:string" use="optional"/>
625+
</xsd:complexType>
626+
627+
<xsd:complexType name="docPlantumlType" mixed="true">
628+
<xsd:group ref="docTitleCmdGroup" minOccurs="0" maxOccurs="unbounded" />
629+
<xsd:attribute name="name" type="xsd:string" use="optional"/>
630+
<xsd:attribute name="width" type="xsd:string" use="optional"/>
631+
<xsd:attribute name="height" type="xsd:string" use="optional"/>
632+
<xsd:attribute name="caption" type="xsd:string" use="optional"/>
633+
<xsd:attribute name="engine" type="DoxPlantumlEngine" use="optional"/>
634+
</xsd:complexType>
635+
612636
<xsd:complexType name="docTocItemType" mixed="true">
613637
<xsd:group ref="docTitleCmdGroup" minOccurs="0" maxOccurs="unbounded" />
614638
<xsd:attribute name="id" type="xsd:string" />
@@ -921,6 +945,28 @@
921945
</xsd:restriction>
922946
</xsd:simpleType>
923947

948+
<xsd:simpleType name="DoxPlantumlEngine">
949+
<xsd:restriction base="xsd:string">
950+
<xsd:enumeration value="uml"/>
951+
<xsd:enumeration value="bpm"/>
952+
<xsd:enumeration value="wire"/>
953+
<xsd:enumeration value="dot"/>
954+
<xsd:enumeration value="ditaa"/>
955+
<xsd:enumeration value="salt"/>
956+
<xsd:enumeration value="math"/>
957+
<xsd:enumeration value="latex"/>
958+
<xsd:enumeration value="gantt"/>
959+
<xsd:enumeration value="mindmap"/>
960+
<xsd:enumeration value="wbs"/>
961+
<xsd:enumeration value="yaml"/>
962+
<xsd:enumeration value="creole"/>
963+
<xsd:enumeration value="json"/>
964+
<xsd:enumeration value="flow"/>
965+
<xsd:enumeration value="board"/>
966+
<xsd:enumeration value="git"/>
967+
</xsd:restriction>
968+
</xsd:simpleType>
969+
924970
<xsd:simpleType name="DoxParamListKind">
925971
<xsd:restriction base="xsd:string">
926972
<xsd:enumeration value="param" />

0 commit comments

Comments
 (0)