Sterling OMS Writing First XSL Program
Can someone write code in OMS without java knowledge? Answer is yes. Using XSL program we should be perform most of the activities similar to Java.
What is XSL?
XSL is a language for expressing style sheets. An XSL style sheet is, like with CSS.
XSLT is a Programming Language and used for processing XML data. That is, transforming XML documents.
- A small set of flexible data types: Boolean, number, string.
- A full set of operations: <xsl:template>, <xsl:apply-templates>, <xsl:sort>,<xsl:output>.
- Programming flow-control: <xsl:if>, <xsl:for-each>, <xsl:choose>, and so on
How XSL will be used in OMS (Simple Example)?
Consider below simple scenario
- Customer wants to get organization details using given input XML (Can be in any format)
- Input XML coming into Service looks as shown below
<?xml version="1.0"?> <Enterprise EnterpriseCode="Matrix" />
We can create below XSL file and convert input XML to required input XML for getOrganizationHierarchy API.
- Create XSL file
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:template match="/">
<xsl:variable name="OrganizationCode" select="/Enterprise/@EnterpriseCode"/>
<Organization OrganizationCode="{$OrganizationCode}" />
</xsl:template>
</xsl:stylesheet>
- Final Result XML to call getOrganizationHierarchy API
<Organization OrganizationCode="Matrix" />
How to build custom code?
- Create mapenterprise.xsl file as under <OMS_Install_Dir>/global/template/xsl/mapenterprise.xsl
- Run Command : deployer.cmd -t resourcejar
- Run Command : buildear.cmd -Dappserver=weblogic -Dwarfiles=smcfs,sbc -Dearfile=smcfs.ear -Dnowebservice=true -Ddevmode=true -Dnodocear=true -Dwls-10=true create-ear
- Run Command: del C:\deploy\smcfs.ear (Deleting old ear file)
- copy <Install Directory>\external_deployments\smcfs.ear C:\deploy
- Manually deploy the ear file in weblogic server
How to test?
- Create new service with name XSLTTest and Service group name Custom
- Add XSL Translator as shown below and enter the file location
- Add API after the XSL translator and connect all the points
Example given here very simple. You can construct any complex XML input using XSL.
Run the test?
Input
Result
What is best with XSL?
- We can do programming with help of browser and no IDE (Integrated Development Environment) needed
- If we know the input XML (coming into service/api) and final XML to call any API/Service, we can apply the XSL easily
- In online there are many websites available to do test the changes
- We can use below URL to test the changes made https://www.freeformatter.com/xsl-transformer.html
- For example

Try yourself?
Can you write java program instead of XSL and generate same XML output?







Thnaks for This example . I want some example like creating local agent and integration server.
Thanks for the comment Aman. We need some more time on agent and integration sever sample. Mean while please see if this link helps
http://activekite.com/2017/05/18/agent-vs-integration-server-ibm-oms/
above link is not working…
Thanks ActiveKite. Can you post examples on when it is best to use XSL and when it’s best to use java code from performance point of view.
Sure. we can do. But in high level
XSL is good when you have very small transformation. Lets say if Order with 100+ lines and if you want to do some logic on order lines, XSL will be slow. If we do the same logic in Java will be much faster. So XSL is good only when you do very small xml manipulation.
Hope helps… Happy learning !!!
I got an erroe called “xsl not found”
Thanks for this valuable information ….we appreciate your valuable time and effort.