xslt template with multiple parameters
878078May 23 2013 — edited Feb 26 2020HI ,
I am unable to test the xslt with a userdefined template. Please help me in resoving the same. Please find the below xslt code.
<?xml version="1.0" encoding="UTF-8" ?>
<?oracle-xsl-mapper <!-- SPECIFICATION OF MAP SOURCES AND TARGETS, DO NOT MODIFY. -->
<mapSources>
<source type="XSD">
<schema location="../xsd/oo.xsd"/>
<rootElement name="exampleElement" namespace="http://www.example.org"/>
</source>
</mapSources>
<mapTargets>
<target type="XSD">
<schema location="../xsd/DBMainInsert_table.xsd"/>
<rootElement name="XxathrTmClmuplstgCollection" namespace="http://xmlns.oracle.com/pcbpel/adapter/db/top/DBMainInsert"/>
</target>
</mapTargets>
<!-- GENERATED BY ORACLE XSL MAPPER 11.1.1.4.0(build 110106.1932.5682) AT [WED MAY 22 17:03:20 IST 2013]. -->
?>
<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:ns0="http://www.example.org"
xmlns:dvm="http://www.oracle.com/XSL/Transform/java/oracle.tip.dvm.LookupValue"
xmlns:hwf="http://xmlns.oracle.com/bpel/workflow/xpath"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
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:xref="http://www.oracle.com/XSL/Transform/java/oracle.tip.xref.xpath.XRefXPathFunctions"
xmlns:ns1="http://xmlns.oracle.com/pcbpel/adapter/db/top/DBMainInsert"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:ora="http://schemas.oracle.com/xpath/extension"
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 ns0 xsd ns1 bpws xp20 mhdr bpel oraext dvm hwf med ids bpm xdk xref ora socket ldap">
<xsl:template match="/">
<ns1:XxathrTmClmuplstgCollection>
<xsl:for-each select="/ns0:exampleElement/ns0:Input">
<ns1:XxathrTmClmuplstg>
<ns1:claimType>
<xsl:value-of select="ns0:claimtype"/>
</ns1:claimType>
<ns1:customer>
<xsl:value-of select="ns0:customer"/>
</ns1:customer>
<ns1:offerCode>
<xsl:value-of select="ns0:offercode"/>
</ns1:offerCode>
<ns1:item>
<xsl:value-of select="ns0:item"/>
</ns1:item>
<ns1:quantity>
<xsl:value-of select="ns0:quantity"/>
</ns1:quantity>
<ns1:rate>
<xsl:value-of select="ns0:rate"/>
</ns1:rate>
<ns1:lineAmount>
<xsl:value-of select="ns0:lineamount"/>
</ns1:lineAmount>
<ns1:consumptionDate>
<xsl:value-of select="ns0:consumptiondate"/>
</ns1:consumptionDate>
<ns1:lineComment>
<xsl:value-of select="ns0:linecomment"/>
</ns1:lineComment>
</ns1:XxathrTmClmuplstg>
</xsl:for-each>
</ns1:XxathrTmClmuplstgCollection>
</xsl:template>
<!-- User Defined Templates -->
<xsl:template name="Validation">
<xsl:param name="gvclaimtype"/>
<xsl:param name="gvcustomer"/>
<xsl:if test='$gvclaimtype = ""'>
<xsl:variable name="tt">
<xsl:value-of select="claimtype is not valid"/>
</xsl:variable>
<xsl:if test="$gvcustomer=''">
<xsl:variable name="t2">
<xsl:value-of select="asbdjkakfh"/>
</xsl:variable>
</xsl:if>
<xsl:value-of select="concat($tt,$t2)"/>
</xsl:if>
</xsl:template>
</xsl:stylesheet>