Wednesday, 6 March 2013

XSLT LOOKUP

Loopup info



<xsl:stylesheet version="1.0" xmlns:bpws="http://schemas.xmlsoap.org/ws/2003/03/business-process/" xmlns:xp20="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.Xpath20" xmlns:mhdr="http://www.oracle.com/XSL/Transform/java/oracle.tip.mediator.service.common.functions.MediatorExtnFunction" xmlns:bpel="http://docs.oasis-open.org/wsbpel/2.0/process/executable" xmlns:oraext="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.ExtFunc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:dvm="http://www.oracle.com/XSL/Transform/java/oracle.tip.dvm.LookupValue" xmlns:tns="http://com.ge.cis.oraclesoa/UP_Inbound_Poller" xmlns:hwf="http://xmlns.oracle.com/bpel/workflow/xpath" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ns0="http://com.ge.cis.oraclesoa/validate/xml" xmlns:med="http://schemas.oracle.com/mediator/xpath" xmlns:ids="http://xmlns.oracle.com/bpel/services/IdentityService/xpath" xmlns:bpm="http://xmlns.oracle.com/bpmn20/extensions" xmlns:xdk="http://schemas.oracle.com/bpel/extension/xpath/function/xdk" xmlns:nxsd="http://xmlns.oracle.com/pcbpel/nxsd" xmlns:xref="http://www.oracle.com/XSL/Transform/java/oracle.tip.xref.xpath.XRefXPathFunctions" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ora="http://schemas.oracle.com/xpath/extension" xmlns:ns1="http://www.com.ge.cis.oraclesoa/validation/nxml" xmlns:lookup="http://www.com.ge.cis.oraclesoa/sampletype/lookup" xmlns:socket="http://www.oracle.com/XSL/Transform/java/oracle.tip.adapter.socket.ProtocolTranslator" xmlns:ldap="http://schemas.oracle.com/xpath/extension/ldap" exclude-result-prefixes="xsi xsl tns nxsd xsd ns0 bpws xp20 mhdr bpel oraext dvm hwf med ids bpm xdk xref ora socket ldap lookup">
   <lookup:definitions>
      <term name="UP4S">OIL</term>
      <term name="UP2S">OIL</term>
      <term name="UPAC">AIR_COMPRESSOR</term>
      <term name="UPCW">COOLANT_WATER</term>
      <term name="UPGL">GLYCOLE_BASED_COOLANT</term>
   </lookup:definitions>
   <xsl:key name="sampletype_lookup" match="lookup:definitions/term" use="@name"/>
   <xsl:variable name="definitions" select="document(&quot;&quot;)//lookup:definitions"/>
   <xsl:template match="/">

.....
...
.....



Function to be used is


                  <SAMPLE_TYPE>
                     <xsl:variable name="sampletype">
                        <xsl:value-of select="/tns:SMTP/tns:Data/tns:SAMPLE_TYPE10"/>
                     </xsl:variable>
                     <xsl:for-each select="$definitions">
                        <xsl:value-of select="key(&quot;sampletype_lookup&quot;, $sampletype)"/>
                     </xsl:for-each>
                  </SAMPLE_TYPE>









No comments:

Post a Comment