326
Views
4
Comments
Validating an XML against an XSD that has schema import elements
Question

Hi,

I have a requirement to validate incoming XML documents against an XSD in OutSystems.

The XmlDocument_Load action from the Xml extension does allow to do this.

However the XSD documents that I have contain schema import elements. 

As the input to the XmlDocument_Load action are the content of the XML and the XSD, and there is no direct access to the XSD's to import, there is no way of course that the import of other XSD documents into the schema will succeed.

I was wondering if anybody else previously had to make a solution for a requirement as this, and how it was done.

Regards,

Daniel

UserImage.jpg
G Andrew Duthie
 
MVP

I'm not sure whether it's possible to validate against XSDs with imports directly in OutSystems.

But worst case, you should be able to create an extension in C# to do this. If you can do it in .NET/C#, you can use that to do it in OutSystems via an extension.

2024-07-05 14-16-55
Daniël Kuhlmann
 
MVP

Hi G. Andrew,

It is not possible right now, that is for sure the input to the XmlDocument_Load is a text parameter that needs to contain the complete XSD, so it can not process import statements.

I do understand that if something can not be done, an extension can be made to extend OutSystems.

My question was to ask if somebody did have this problem and did solve it. So that I could learn from that.

Regards,

Daniel

2020-03-18 10-33-53
Felipe Carvalho

Hi @Daniel Kuhlmann,

I am having the same issue. Regarding it is an old discussion, did you find another solution instead of developing an extension?

Thank you!

UserImage.jpg
wilko odijk

Daniël hi,

I have the same problem here, the dutch StUF standards for data exchange have the xsd files available, but these xsd files refer to other xsd files. For example the xsd to use is "bg0310_msg_mutatie.xsd", which has references to "bg0310_msg_stuf_mutatie.xsd". This xsd then refers to "../entiteiten/bg0310_stuf_simpleTypes.xsd" so there is a hierarchy.

The solution is to make an extension, but with that I have little experience, so if pointers are available for that, it is appreciated.

Saludos,

Wilko

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.