Example XSLT File

The following is an example of an XSLT file that sets the routing key as SILVER. Set any value for the routing key in the XSLT file to overwrite the Preferred Routing Key value specified in the Facade Access tab.

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns:fn="http://www.w3.org/2005/xpath-functions"
  xmlns:c="http://www.tibco.com/schemas/asg/context"
  xmlns:h="http://www.tibco.com/asg/protocols/http"
  exclude-result-prefixes="xsl fn h c">
  <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes" omit-xml-declaration="no"/>
<xsl:variable name="contextHref">
  <xsl:value-of select="/transformation/context/@href"/>
</xsl:variable>
<xsl:variable name="httpRequest">
  <xsl:copy-of select="document($contextHref)/c:context/c:entry[@key='asg:httpRequest']/h:request"/>
</xsl:variable>
<xsl:template match="/">
<output>
<routingKey>SILVER</routingKey>
</output>
</xsl:template>
</xsl:stylesheet>