File XSLT
XSLT (Extensible Stylesheet Language) is a XML-based language used for the transformation of XML documents into other XML documents. Using XSLT, OIPA transforms the inbound payload of the SOAP message into AsXml, which can then be processed by the system.
OIPA adheres to XSLT Version 2 specifications, which allows for very flexible configuration of the transformation process. Standard XSLT elements can be used to transform the inbound message into AsXml based on templates and perform data validation and error handling.
Using Attributes from XMLData
Each Attribute defined in the XMLData section that will be needed in the XSLT stylesheet must first be declared as a parameter in the XSLT.
As an example, if an Attribute named PolicyGuid was set in the XMLData section, and its value needs to be referenced in the XSLT, the following would need to be added in the beginning of the XSLT, directly proceeding the prolog.
PolicyGUID Attribute
Functions
Several functions are available for use inside of the XSLT stylesheet. This provides for added functionally such as generating GUIDs and retrieving the current system time.
In order to use these added functions, the XsltFunctionHelper class must be added as a namespace in the XSLT prolog as noted below.
Xslt Function Helper Class
The getNextGUID() function will generate a new GUID. As an example, the following code would output a newly generated GUID inside of the <PolicyGuid> element.
getNextGUID Function
Functions can also be used to retrieve the current system time and then format it properly for insertion into the database.
Functions in Xsl
Validation and Error Handling
File has the ability to perform data validations using the XSLT portion of the configuration. As an example, the value of a variable can be tested to ensure the value is as expected. The following validation syntax can be used anywhere in the XSLT.
Data Validations
After evaluation, if the <xsl:if> expression is true, then the <ValidationError> element will be included in the resulting AsXml. If one or more <ValidationError> elements exist in the AsXml, then a SOAP fault will be thrown and the text within the element and the ERRORSTATUSCODE will be returned to the caller as part of the SOAP fault.