AndrewHoward 0 Posted November 14, 2022 Hi, This code validates XML against XSD but it returns the first error. How can I make it return all erros in XML in one go ? Thank you. function TXmlValidator.ValidateXml(const XmlFileName: string; const SchemaCollection: IXMLDOMSchemaCollection2): Boolean; var XmlDocument: IXMLDOMDocument3; parseError: IXMLDOMParseError; begin XmlDocument := TmsxmlFactory.CreateXMLDOMDocument3WithValidateOnParseFromFile(XmlFileName); XmlDocument.schemas := SchemaCollection; parseError := XmlDocument.validate(); FValidationResult := TXMLDOMParseErrorToString.ToString(parseError); Result := ValidationResult = NullAsStringValue;; end; Share this post Link to post