Transformations (XSLT Mapping)
Response type for transformations.
To define the XSLT mapping for facade or target request and response messages, files are defined in the Mapping tab of the Config UI. See XSLT Mapping Type.
For the XSLT mapping, the Response Type indicates the output of the transformations, which can be as follows:
Payload
If the Response Type is specified as Payload, the output document of the transformation contains just the payload and is used as the request payload for the next stage in the request pipeline processing.
The output document of the mapping transformation either becomes a canonical request or a southbound request, just depending on where you are in the request processing pipeline.
For example, the output document from the northbound forward mapping is a payload XML document. This becomes the canonical request and is populated as the input for the southbound forward mapping.
Full
If the Response Type is specified as Full, you can access additional fields from the transaction object. The main field is the request context field which contains the HTTP headers information, URI, user name, and other authentication fields.
This provides the mapping and transformations of the full transaction (request) object. The transaction context contains the header information and the payload. After the transformation is done, the Core Engine processes the request as follows:
- The value of the transaction context is replaced by the output document from the transformation.
- The payload is extracted from the transaction context and is used for the next stage in the request pipeline processing.
You can do the following using the Response Type as Full transformation:
- Map and update the document with additional fields available in the request context (HTTP headers, JMS headers, and so on).
- Set error code for content validation.
- Create documents for enumeration orchestration.
<xsl:variable name="nbRequestHref"> <xsl:value-of select="/transformation/nbRequest/@href" /> </xsl:variable> <xsl:variable name="nbRequest"> <xsl:copy-of select="document($nbRequestHref)/*" /> </xsl:variable> <xsl:variable name="RequestParam"> <xsl:value-of select="$nbRequest//book:Request" /> </xsl:variable> <xsl:template match="/"> <map:mapping-result> <map:context> <c:context> <c:entry key="asg:httpRequest"> <h:override-URI> <xsl:value-of select="concat('/Books/BookOperations/Title/', $RequestParam)" /> </h:override-URI> </c:entry> <c:entry key="http:override"> <h:override-header name="accept">application/xml</h:override-header> <h:override-header name="content-type">application/xml</h:override-header> </c:entry> </c:context> </map:context> <map:payload-xml> <html/> </map:payload-xml> </map:mapping-result> </xsl:template>The template includes the following elements:
The following functionality is implemented using the Full Response Type of mapping transformation capability:
- Set error codes for content validation
- Validation
- Implementing Request Validation
- Map the Protocol Headers in Request Context
- Enumeration Orchestration
Enumeration Orchestration is implemented using the mapping capability of TIBCO API Exchange Gateway. - Response Transformation
Use the following tag in your reverse northbound mapping to apply transformations to a response before sending it out.