OCLOperators XmlValidateWithSchemas
No edit summary
No edit summary
Line 3: Line 3:
This operator reads one or more XML Schemas and validates the supplied xml in regards to those schemas.
This operator reads one or more XML Schemas and validates the supplied xml in regards 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)
  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 <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.

Revision as of 11:53, 17 August 2021

selfVM.XmlValidateWithSchemas(somexml,collection of urls to schemas)

This operator reads one or more XML Schemas and validates the supplied xml in regards 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.
This page was edited 97 days ago on 02/10/2024. What links here