Please enable JavaScript to view this site.

InterFormNG Manual 2020

Navigation: Tools

Validation of input XML files

Scroll Prev Top Next More

The input XML files used for InterFormNG can be validated. The validation is done via an XSLT. The name of the XSLT file used for the validation, depends on the contents of the input XML file.

 

The input XML file is assumed to have the 3 key nodes as specified in the section above (The input XML format):

 

/Data/Header/Client

/Data/Header/Type

/Data/Header/Subtype

 

The contents of these nodes (if they exists) are used to build up a name of the .xsl file, that is used for the validation (if enabled):

The expected xsl file is called:

 

<Client>-<Type>-<Subtype>.xsl, however InterFormNG will first look for these generic files:

 

<Client>.xsl, and if not found: <Client>-<Type>.xsl, and if also not found then:  

<Client>-<Type>-<Subtype>.xsl

 

Some .xsl files for the automotive module are delivered with InterFormNG. In short a failed validation can be identified by the number of /svrl:failed-assert nodes: If there are at least one, then the validation failed. Each /svrl:failed-assert node lists one test, that failed and the reference to the node in the input XML file, that failed.

 

If there is no validation files, that fits the input XML file (even though validation is activated), then InterFormNG will simply not validate the input file.

 

If you want to use generic .xsl files to cover many types of XML files, you can simply create either a <Client>.xsl or <Client>-<Type>.xsl file, if you then want to disable validation for some exceptions (types or substypes) for these generic files, then you should just create empty files with the specific file names.

 

The validation for the automotive package is activated and defined, via the web interface under ‘General’ and ‘Validation’:

 

InterFormNG_Automotive_Validation_001

The parameters have these functions:

 

Enable validation

If this is activated, then InterFormNG will try to validate all input XML files, that selects a rule with an action in the Workflow (Template selection).

 

The fact, that the validation is done, only if a rule with an action is found, opens up for the possibility to transform input XML files with contents (in a rule with transform - without actions), that does not fit the correct XML format (or add extra data) before being validated (in a rule with an action).

 

Always validate

It is recommended not to use this option, as it may be removed from future versions of InterFormNG. If enabled, any Input XML file will be validated (if a matching .xsl file is found) - no matter if a rule in workflow has been selected or not.

 

This feature can be used, if you only want to validate an input XML file without generating any type of output. Alternatively you can use a special rule, that creates some dummy output e.g. a PDF file, that is overwritten.

 

Reply address        

If you register a http reply addess here, then the result of the validation will be reported via an http post. The post will use the port number setup on the next parameter.

 

Reply port                

The port number to use for the reply, that includes the result of the validation.

 

Always send reply

The result of the validation will normally only be sent back, if the XML file failed the validation. Alternatively you can activate this option to make InterFormNG always send a reply back (not matter if the validation fails or not).  

 

Transformation XSL

The result of the validation is a new XML file. If you want to change the contents of these XML files, then you can refer to another XSL file here. This will transform the XML output from the validation into the format of your choice.

 

Only warn

What should be the result of a failed validation? As default processing will stop with an error. If you activate this (Only warn) option, then only a warning will be added to both the service log and to the LogDB, and processing will proceed in spite of the failed validation.