Ja pouzivam nieco taketo. Vracia to string chyb. Ak je prazdny je validacia OK.
function CheckSchema(const formFile: string; const schemaFile: string): string;
var
xml, xsd: IXMLDOMDocument2;
cache: IXMLDOMSchemaCollection;
err: Boolean;
schemas: IXMLDOMSchemaCollection;
begin
xml := CoDOMDocument60.Create;
xml.load(formFile);
schemas := xml.namespaces;
xsd := CoDOMDocument60.Create;
xsd.Async := False;
xsd.load( schemaFile );
cache := CoXMLSchemaCache60.Create;
cache.add(schemas.namespaceURI[0], xsd);
xml := CoDOMDocument60.Create;
xml.async := False;
xml.schemas := cache;
xml.validateOnParse := True;
xml.resolveExternals := True;
err := xml.load(formFile);
if not err then
result := XMLDOMParseErrorToStringUnit.TXMLDOMParseErrorToString.ToString ( xml.parseError )
else
result := '';
end;