diff options
author | Martin Smith <martin.smith@nokia.com> | 2010-10-20 11:40:49 (GMT) |
---|---|---|
committer | Martin Smith <martin.smith@nokia.com> | 2010-10-20 11:40:49 (GMT) |
commit | 2ec8af79c81caf960c54913d0a57c89b74606b34 (patch) | |
tree | 4ac7033e9715559eca9615dcc71fdc8076554258 /tools/qdoc3 | |
parent | c0836f9101f48c3c37ea477c66c49fd3dc08dfb5 (diff) | |
download | Qt-2ec8af79c81caf960c54913d0a57c89b74606b34.zip Qt-2ec8af79c81caf960c54913d0a57c89b74606b34.tar.gz Qt-2ec8af79c81caf960c54913d0a57c89b74606b34.tar.bz2 |
qdoc: Fixed some DITA XML validation errors.
Diffstat (limited to 'tools/qdoc3')
-rw-r--r-- | tools/qdoc3/ditaxmlgenerator.cpp | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/tools/qdoc3/ditaxmlgenerator.cpp b/tools/qdoc3/ditaxmlgenerator.cpp index 668d6ed..062a023 100644 --- a/tools/qdoc3/ditaxmlgenerator.cpp +++ b/tools/qdoc3/ditaxmlgenerator.cpp @@ -1403,6 +1403,19 @@ int DitaXmlGenerator::generateAtom(const Atom *atom, tableColumnCount = 0; break; case Atom::TableHeaderLeft: + if (inTableBody) { + xmlWriter().writeEndElement(); // </tbody> + xmlWriter().writeEndElement(); // </tgroup> + xmlWriter().writeEndElement(); // </table> + inTableHeader = false; + inTableBody = false; + tableColumnCount = 0; + xmlWriter().writeStartElement("table"); + numTableRows = 0; + tableColumnCount = countTableColumns(atom); + xmlWriter().writeStartElement("tgroup"); + xmlWriter().writeAttribute("cols",QString::number(tableColumnCount)); + } xmlWriter().writeStartElement("thead"); xmlWriter().writeAttribute("valign","top"); xmlWriter().writeStartElement("row"); @@ -1446,8 +1459,6 @@ int DitaXmlGenerator::generateAtom(const Atom *atom, QString s = "span(" + spans[0] + "," + spans[1] + ")"; xmlWriter().writeAttribute("outputclass",s); } - if (!inTableHeader) - xmlWriter().writeStartElement("p"); } if (matchAhead(atom, Atom::ParaLeft)) skipAhead = 1; @@ -1457,7 +1468,6 @@ int DitaXmlGenerator::generateAtom(const Atom *atom, if (inTableHeader) xmlWriter().writeEndElement(); // </entry> else { - xmlWriter().writeEndElement(); // </p> xmlWriter().writeEndElement(); // </entry> } if (matchAhead(atom, Atom::ParaLeft)) @@ -1493,10 +1503,14 @@ int DitaXmlGenerator::generateAtom(const Atom *atom, } break; case Atom::Target: + if (in_para) { + xmlWriter().writeEndElement(); // </p> + in_para = false; + } xmlWriter().writeStartElement("p"); writeGuidAttribute(Doc::canonicalTitle(atom->string())); xmlWriter().writeAttribute("outputclass","target"); - xmlWriter().writeCharacters(protectEnc(atom->string())); + //xmlWriter().writeCharacters(protectEnc(atom->string())); xmlWriter().writeEndElement(); // </p> break; case Atom::UnhandledFormat: |