Friday, July 27, 2012

Passing parameter to XSLT in Oracle SOA Suite 11g


Passing parameter to XSLT in Oracle SOA Suite 11g

Not like Oracle SOA Suite 10g, in Oracle SOA Suite 11g the parameters can be directly added into the Transform activity from GUI.
The parameters can be of any schema element type; the XML Schema Simple types are not accepted.

Create a schema definition that will have the parameter definition e.g.
Here, I have defined the schema to pass the parameters startIndex and endIndex to the XSLT.

<?xml version="1.0" encoding="UTF-8" ?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
            xmlns="http://schemas.oracle.com/parameters"
            targetNamespace="http://schemas.oracle.com/parameters"
            elementFormDefault="qualified">
 <xsd:element name="parameters">
    <xsd:complexType>
      <xsd:sequence>      
              <xsd:element name="startIndex" type="xsd:string"/>
              <xsd:element name="endIndex" type="xsd:string"/>
            </xsd:sequence>     
    </xsd:complexType>
  </xsd:element>
</xsd:schema>

Create the variable (e.g. parameters) of required element type defined in the schema, in my case the element name is parameters.


Open the Transform activity and select the Input/output variables. Add the parameters variable in the source section, the first variable that is added becomes the source for the transformation activity. These additional variables become as parameters to the transform file.


The parameter can be accessed using the syntax: $parametername+ XPath expression for the node.



2 comments:

  1. You know how to do this exact thing but using OSB ? i m realley stuck there. THanks !

    ReplyDelete
  2. hi, can you please tell me how create and to pass dynamic parameters in osb12c

    ReplyDelete