<$BlogRSDURL$>
Philip's Files

My Web Site

Friday, April 05, 2013
 
Using bind variables in XSLT transforms in OSB


Using Parameters for XSLT tranforms in OSB

Recently I wanted to use parameters in XSLT resources in OSB.
The procedure is relatively straightforward, but I could find a nice summary anywhere - so here it is:

For Oracle Service Bus 11gR1 using the web interface:



<xsl:param name="TransactionID"/>


 <xsl:value-of select="$TransactionID"/>
 e.g.

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:get="http://redacted.corp/VcIDV/wsdls/getPersonDetailsA"
xmlns:get2="http://redacted.corp/VcIDV/wsdls/getPersonDetails"

exclude-result-prefixes="http://redacted.corp/VcIDV/wsdls/getPersonDetailsA">

<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes" omit-xml-declaration="no"/>

<xsl:param name="TransactionID"/>

<xsl:template match="@*|node()">
  <xsl:copy>
    <xsl:apply-templates select="@*|node()"/>
  </xsl:copy>
</xsl:template>

<xsl:template match="SearchCriteria[SearchCriteria]">
       <SearchCriteria>
    <CombinationType>AND</CombinationType>
    <TransactionID><xsl:value-of select="$TransactionID"/></TransactionID>
     <xsl:apply-templates select="@* | *"/>
  </SearchCriteria>
</xsl:template>

<xsl:template match="get:getPersonDetailsA">
       <get2:getPersonDetails>
     <xsl:apply-templates select="@* | *"/>
  </get2:getPersonDetails>
</xsl:template>

</xsl:stylesheet>


Then when adding an XSLT resource, after having selected it, it should show up as a Bind Variable on the addition page.

e.g. using it in an Assign:










Powered by Blogger

My Livejournal