OCLOperators XmlValidateWithSchemas
Created by Hans.karlsen on 2021-08-17 · Last edited by Sandra.akech on 2025-12-12.
selfVM.XmlValidateWithSchemas(somexml, collection of URLs to schemas)
This operator reads one or more XML Schemas and validates the supplied XML in regard to those schemas.
selfVM.XmlValidateWithSchemas( '<root/>' , Set{'http://www.gdsregistry.org/3.1/schemas/gs1/gdsn/CatalogueItemNotification.xsd'} )->foreach(s|self.Details.Add(Detail.Create);self.Details->last.Attribute1:=s)
Output in strings will look something like this:
Error: The 'gtin' element is invalid - The value '' is invalid according to its datatype 'urn:gs1:shared:shared_common:xsd:3:GTINType' - The Pattern constraint failed. Warning: No schema for root element.
Summary Table:
| Input Values | Operation Performed | Result Produced |
|---|---|---|
| XML string | Checks it against the given XSD rules | List of error/warning messages |
| Schema URLs | Defines what âvalid XMLâ looks like | Empty list if XML is valid |
| Example invalid XML | Reports missing or wrong values | Detailed problem messages |
