Don't generate invalid XML

An attribute is not allowed twice in XML. So change the
associated-property attribute, so that it contains a list
of associated properties is required instead of listing them
a couple of times.

Change-Id: Ibfb21c1a1de5ed39cda2eb29ac318bdbbf0eab4e
Reviewed-by: Martin Smith <martin.smith@digia.com>
This commit is contained in:
Lars Knoll 2015-07-23 08:46:16 +02:00
parent dbf4c6290f
commit 1945441986

View File

@ -1190,9 +1190,13 @@ bool QDocIndexFiles::generateIndexSection(QXmlStreamWriter& writer,
writer.writeAttribute("relates", functionNode->relates()->name()); writer.writeAttribute("relates", functionNode->relates()->name());
} }
if (functionNode->hasAssociatedProperties()) { if (functionNode->hasAssociatedProperties()) {
QString associatedProperties;
foreach (PropertyNode* pn, functionNode->associatedProperties()) { foreach (PropertyNode* pn, functionNode->associatedProperties()) {
writer.writeAttribute("associated-property", pn->name()); if (!associatedProperties.isEmpty())
associatedProperties += QLatin1String(", ");
associatedProperties += pn->name();
} }
writer.writeAttribute("associated-property", associatedProperties);
} }
writer.writeAttribute("type", functionNode->returnType()); writer.writeAttribute("type", functionNode->returnType());
if (!brief.isEmpty()) if (!brief.isEmpty())