summaryrefslogtreecommitdiffstats
path: root/src/xmlgen.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/xmlgen.cpp')
-rw-r--r--src/xmlgen.cpp29
1 files changed, 27 insertions, 2 deletions
diff --git a/src/xmlgen.cpp b/src/xmlgen.cpp
index 7cef7d7..2f58fd4 100644
--- a/src/xmlgen.cpp
+++ b/src/xmlgen.cpp
@@ -47,6 +47,14 @@
// debug inside output
//#define XML_DB(x) QCString __t;__t.sprintf x;m_t << __t
+//------------------
+
+static const char index_xsd[] =
+#include "index_xsd.h"
+;
+
+//------------------
+
inline void writeXMLString(QTextStream &t,const char *s)
{
@@ -1448,16 +1456,33 @@ void generateXML()
}
}
QDir xmlDir(outputDirectory);
- QCString fileName=outputDirectory+"/index.xml";
+ QCString fileName=outputDirectory+"/index.xsd";
QFile f(fileName);
if (!f.open(IO_WriteOnly))
{
err("Cannot open file %s for writing!\n",fileName.data());
return;
}
+ f.writeBlock(index_xsd,strlen(index_xsd));
+ f.close();
+
+ fileName=outputDirectory+"/index.xml";
+ f.setName(fileName);
+ if (!f.open(IO_WriteOnly))
+ {
+ err("Cannot open file %s for writing!\n",fileName.data());
+ return;
+ }
QTextStream t(&f);
t.setEncoding(QTextStream::Latin1);
- writeXMLHeader(t);
+
+ // write index header
+ t << "<?xml version='1.0' encoding='" << theTranslator->idLanguageCharset()
+ << "' standalone='no'?>" << endl;;
+ t << "<doxygen xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" ";
+ t << "xsi:noNamespaceSchemaLocation=\"index.xsd\" ";
+ t << "version=\"" << versionString << "\">" << endl;
+
ClassSDict::Iterator cli(Doxygen::classSDict);
ClassDef *cd;
for (cli.toFirst();(cd=cli.current());++cli)