Edit XSLT Code in the Mapper
You can directly edit the XSLT code of your mappings inside the mapper. This action is useful for use cases in which mapping is not possible in the graphical mapper. This eliminates the need to export your XSLT code from Oracle Integration, edit the code manually in a text editor or in a separate graphical tool such as Eclipse or Oracle JDeveloper, and then re-import the code into the mapper in Oracle Integration.
- Create internal variables using
<xsl:variable>
- Correlate multiple sources grouped by key
fields using
<xsl:for-each-group>
- Dynamically create target name-value pairs
based on runtime data using
<xsl:element>
,<xsl:attribute>
- Implement "push style" XSLT using
<xsl:template>
,<xsl:call-template>
, and<xsl:apply-templates>
- Write your own functions in XSLT using
<xsl:function>
- Copy node sets using
<xsl:copy>
and<xsl:copy-of>
- Click Code.
The current XSLT code for your mappings is displayed.
Description of the illustration mapper_code.png
See the following sections for XSLT code editing guidelines:
Restrictions on Editing
- Attribute version
numbers:
<xsl:stylesheet version="2.0"
- The mapper schema section where sources and
targets are
specified:
<oracle-xsl-mapper:schema xml:id="id_2"> <!--SPECIFICATION OF MAP SOURCES AND TARGETS, DO NOT MODIFY.--> <oracle-xsl-mapper:mapSources xml:id="id_3"> <oracle-xsl-mapper:source type="WSDL" xml:id="id_4"> <oracle-xsl-mapper:schema location="../../application_8/outbound_9/resourcegroup_10/echoRequest_REQUEST.wsdl" xml:id="id_5"/> <oracle-xsl-mapper:rootElement name="execute" namespace="http://xmlns.oracle.com/cloud/adapter/REST/echoRequest_REQUEST/types" xml:id="id_6"/> </oracle-xsl-mapper:source> <oracle-xsl-mapper:source type="WSDL" xml:id="id_20"> <oracle-xsl-mapper:schema location="../../processor_83/resourcegroup_84/sList_REQUEST.wsdl" xml:id="id_21"/> <oracle-xsl-mapper:rootElement name="ListFilesResponse" namespace="http://xmlns.oracle.com/cloud/adapter/stagefile/sList_REQUEST/types" xml:id="id_22"/> <oracle-xsl-mapper:param name="sList" xml:id="id_23"/> </oracle-xsl-mapper:source> <oracle-xsl-mapper:source type="XSD" xml:id="id_24"> <oracle-xsl-mapper:schema location="../../processor_27/resourcegroup_28/ICSIntegrationMetadata.xsd" xml:id="id_25"/> <oracle-xsl-mapper:rootElement name="metadata" namespace="http://www.oracle.com/2014/03/ic/integration/metadata" xml:id="id_26"/> <oracle-xsl-mapper:param name="self" xml:id="id_27"/> </oracle-xsl-mapper:source> </oracle-xsl-mapper:mapSources> <oracle-xsl-mapper:mapTargets xml:id="id_7"> <oracle-xsl-mapper:target type="WSDL" xml:id="id_8"> <oracle-xsl-mapper:schema location="../../application_8/outbound_9/resourcegroup_10/echoRequest_REQUEST.wsdl" xml:id="id_9"/> <oracle-xsl-mapper:rootElement name="executeResponse" namespace="http://xmlns.oracle.com/cloud/adapter/REST/echoRequest_REQUEST/types" xml:id="id_10"/> </oracle-xsl-mapper:target> </oracle-xsl-mapper:mapTargets> <!--GENERATED BY ORACLE XSL MAPPER 12.1.2.0.0--> </oracle-xsl-mapper:schema>
- The global parameter declaration
section:
<xsl:param name="sList" xml:id="id_28"/> <xsl:param name="self" xml:id="id_29"/> <xsl:param name="tracking_var_1" xml:id="id_30"/> <xsl:param name="tracking_var_2" xml:id="id_31"/> <xsl:param name="tracking_var_3" xml:id="id_32"/> <xsl:param name="var_assignment_1" xml:id="id_33"/>
Toolbar Options
The toolbar above your XSLT code provides a series of shortcuts for navigating through and editing XSLT code.
Option | Description |
---|---|
![]() |
Undo your last editing changes to the XSLT code. |
![]() |
Redo your last editing changes to the XSLT code. |
![]() |
Search for specific entries in
your XSLT code. Use the next (![]() ![]() |
![]() |
Find and replace specific
entries in your XSLT code.
|
![]() |
Enter the line number in your XSLT code to access. |
Edit the XSLT Code
<xsl:template match="/" xml:id="id_11">
<nstrgmpr:executeResponse xml:id="id_12">
<nstrgdfl:response-wrapper xml:id="id_16">
<nstrgdfl:Message xml:id="id_17">
<xsl:value-of select="/nstrgmpr:execute/nstrgmpr:TemplateParameters/nsmpr0:message" xml:id="id_18"/>
</nstrgdfl:Message>
<nstrgdfl:Welcome xml:id="id_19">"Welcome to OIC!!! Echo was successful."</nstrgdfl:Welcome>
</nstrgdfl:response-wrapper>
</nstrgmpr:executeResponse>
</xsl:template>
<nstrgdfl:Welcome
<nstrgdfl:Welcome xml:id="id_19">"Welcome to OIC!!! Echo was successful."
</nstrgdfl:Welcome>
This code is currently visible in the mapper as literal
text:
- Replace the literal value of
"Welcome to OIC!!! Echo was successful."
with the variable$tracking_var_3
:<nstrgdfl:Welcome xml:id="id_19"> <xsl:value-of select="$tracking_var_3" xml:id="id_18"/> </nstrgdfl:Welcome>
- Click Designer.
The designer is updated to reflect your changes:
Note:
If you make changes that the mapper does not recognize and attempt to click Designer, the tab is disabled and a message is displayed indicating that the change is not supported. You must resolve those issues before you can return to the designer. - Click Validate or Close (which also performs validation) to exit the mapper, then click Apply to save your changes when prompted.
Code Validation
As you make updates to the XSLT code, your changes are validated. Validation safeguards prevent you from returning to the designer if there are errors. For example:
- Typographical errors:
- Assume you make a typographical error such as
forgetting the
f
at the end ofxsl:value o
. - Click
Designer. An error message
is displayed in the banner and you are prevented
from returning to the designer until you fix the
error.
Unknown: xsl:value-o
- Correct the error and click Designer to return to the designer.
- Assume you make a typographical error such as
forgetting the
- XML syntax errors:
- Assume you make an XML syntax error
such as forgetting to enter a closing bracket
(
>
) afterWelcome
in the following code. The subsequent code is highlighted in red to indicate an error. - Click
Designer. An error message
is displayed in the banner and you are prevented
from returning to the designer or accessing other
tabs such as Test until you
fix the
error.
There are syntax errors in the edited code. Please fix them before navigating away from the tab
- Correct the error and click Designer to return to the designer.
- Assume you make an XML syntax error
such as forgetting to enter a closing bracket
(
- Unsupported constructs in the mapper (for example,
you import XSLT code into the mapper that includes
unsupported functions):
- Click the edit icon to open the
mapper.
The Code tab opens by default with the following message.
- Expand the number to the left of
the error for details. For example:
These are coding patterns and constructors that are not supported in the designer. The designer does not know how to render or manage them. When the XSTL code includes unsupported patterns or constructors, you cannot navigate to the designer.
- Click the edit icon to open the
mapper.