有人用过QXmlSchemaValidator吗?请教一下
const QByteArray xmlData = xmlFile.readAll();
const QByteArray schemaData = schemaFile.readAll();
QXmlSchema schema;
schema.load(schemaData);
bool errorOccurred = false;
if (!schema.isValid())
{
errorOccurred = true;
}
else
{
QXmlSchemaValidator validator(schema);
if (!validator.validate(xmlData))
{
errorOccurred = true;
}
}