OCLOperators XmlValidateWithSchemas
No edit summary
(Updated Edited template to July 12, 2025.)
 
(6 intermediate revisions by 2 users not shown)
Line 1: Line 1:
selfVM.XmlValidateWithSchemas(somexml, collection of urls to schemas)
<message>Write the content here to display this box</message>
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.
This operator reads one or more XML Schemas and validates the supplied XML in regard to those schemas.
Line 6: Line 7:
  Error: The 'gtin' element is invalid - The value <nowiki>''</nowiki> is invalid according to its datatype '<nowiki>urn:gs1:shared:shared_common:xsd:3:GTINType'</nowiki> - The Pattern constraint failed.
  Error: The 'gtin' element is invalid - The value <nowiki>''</nowiki> is invalid according to its datatype '<nowiki>urn:gs1:shared:shared_common:xsd:3:GTINType'</nowiki> - The Pattern constraint failed.
  Warning: No schema for root element.
  Warning: No schema for root element.
[[Category:OCLOperators]]
  [[Category:OCLOperators]]
[[Category:OCL ViewModel Operators]]
{{Edited|July|12|2025}}

Latest revision as of 05:56, 20 January 2025

This page was created by Hans.karlsen@mdriven.net on 2021-08-17. Last edited by Edgar on 2025-01-20.

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.