3 Replies Latest reply: Dec 12, 2012 5:41 PM by vladodias RSS

    XSLT transformation failed

    972017
      Hi All,

      I have the following transformation and the source xml as below.
      When i test it in jdeveloper , it's giving "Unable transform,source XML is null".
      On the traget XML , there is no data and the error is " Document has no root element ,start of root element expected".

      XSLT:
      <?xml version="1.0" encoding="UTF-8" ?>
      <?oracle-xsl-mapper
      <!-- SPECIFICATION OF MAP SOURCES AND TARGETS, DO NOT MODIFY. -->
      <mapSources>
      <source type="WSDL">
      <schema location="../ProcessEcoproductReqABCSImpl.wsdl"/>
      <rootElement name="body" namespace="http://xmlns.oracle.com/finan"/>
      </source>
      </mapSources>
      <mapTargets>
      <target type="WSDL">
      <schema location="../Siebel_ProductsEBSRef.wsdl"/>
      <rootElement name="EcoSiebel_ProductsRequestEBM" namespace="http://xmlns.oracle.com/EnterpriseObjects/Core/EBO/product/V2"/>
      </target>
      </mapTargets>
      <!-- GENERATED BY ORACLE XSL MAPPER 11.1.1.6.0(build 111214.0600.1553) AT [TUE DEC 11 18:59:36 GMT 2012]. -->
      ?>
      <xsl:stylesheet version="2.0"
      xmlns:svcdoc="http://xmlns.oracle.com/Services/Documentation/V1"
      xmlns:aia="http://www.oracle.com/XSL/Transform/java/oracle.apps.aia.core.xpath.AIAFunctions"
      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:bpel="http://docs.oasis-open.org/wsbpel/2.0/process/executable"
      xmlns:sibabcs="http://xmlns.oracle.com/ABCSImpl/product/Core/ProcessEcoproductReqABCSImpl/V1"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns:ns0="http://xmlns.oracle.com/EnterpriseServices/Core/product/V2"
      xmlns:ns2="http://xmlns.oracle.com/EnterpriseObjects/Core/Custom/EBO/product/V2"
      xmlns:bpm="http://xmlns.oracle.com/bpmn20/extensions"
      xmlns:plnk="http://schemas.xmlsoap.org/ws/2003/05/partner-link/"
      xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
      xmlns:ns1="http://xmlns.oracle.com/EnterpriseObjects/Core/Custom/Common/V2"
      xmlns:ora="http://schemas.oracle.com/xpath/extension"
      xmlns:socket="http://www.oracle.com/XSL/Transform/java/oracle.tip.adapter.socket.ProtocolTranslator"
      xmlns:sibabo="http://xmlns.oracle.com/finan"
      xmlns:wsa="http://schemas.xmlsoap.org/ws/2003/03/addressing"
      xmlns:hashmap="http://www.oracle.com/XSL/Transform/java/java.util.HashMap"
      xmlns:mhdr="http://www.oracle.com/XSL/Transform/java/oracle.tip.mediator.service.common.functions.MediatorExtnFunction"
      xmlns:orcl="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.ExtFunc"
      xmlns:dvm="http://www.oracle.com/XSL/Transform/java/oracle.tip.dvm.LookupValue"
      xmlns:hwf="http://xmlns.oracle.com/bpel/workflow/xpath"
      xmlns:med="http://schemas.oracle.com/mediator/xpath"
      xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
      xmlns:ids="http://xmlns.oracle.com/bpel/services/IdentityService/xpath"
      xmlns:ns3="urn:oasis:names:tc:xacml:2.0:policy:schema:cd:04"
      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:xsd="http://www.w3.org/2001/XMLSchema"
      xmlns:ebs="http://xmlns.oracle.com/EnterpriseServices/Core/EBO/product/V2"
      xmlns:corecom="http://xmlns.oracle.com/EnterpriseObjects/Core/Common/V2"
      xmlns:ebo="http://xmlns.oracle.com/EnterpriseObjects/Core/EBO/product/V2"
      xmlns:xacml="urn:oasis:names:tc:xacml:2.0:context:schema:cd:04"
      xmlns:ehdr="http://www.oracle.com/XSL/Transform/java/oracle.tip.esb.server.headers.ESBHeaderFunctions"
      xmlns:ldap="http://schemas.oracle.com/xpath/extension/ldap"
      exclude-result-prefixes="xsi xsl svcdoc sibabcs plnk soap sibabo xsd ns0 ns2 ns1 wsa ns3 ebs corecom ebo xacml aia bpws xp20 bpel bpm ora socket mhdr orcl dvm hwf med ids xdk xref ldap">
      <!--- Modify these variables to suite for your integration scenario -->
      <!--- Add variables suitable for your integration scenario below this line -->
      <xsl:variable name="Sender">
      <xsl:call-template name="GetSenderNode"/>
      </xsl:variable>
      <xsl:variable name="DVMSourceCol" select="$Sender/corecom:Sender/corecom:ID"/>
      <xsl:variable name="DVMTargetCol">COMMON</xsl:variable>
      <xsl:variable name="XREFSourceCol"
      select="$Sender/corecom:Sender/corecom:ID"/>
      <xsl:variable name="XREFTargetCol">COMMON</xsl:variable>
      <xsl:variable name="AIASchemeAgencyID">AIA_01</xsl:variable>
      <xsl:variable name="AppSchemeAgencyID"
      select="$Sender/corecom:Sender/corecom:ID"/>
      <xsl:include href="Xform_EcoABMReqMsg_to_EcoproductEBMReqMsg_Custom.xsl"/>
      <xsl:include href="Xform_EcoABMHeader_to_EcoproductEBMHeader.xsl"/>
      <xsl:template match="/">
      <ebo:EcoSiebel_ProductsRequestEBM>
      <!--- Set the values for the parameters for EBM header template to suit your integration scenario and call EBM header template here -->
      <!--- Call your EBM Header template here
           Sample EBM Header template call
           <xsl:call-template name="EBMHeader">
                <xsl:with-param name="BusinessScopeIDPath" select="'/sbldata:ListOfSWIOrderIO/sbldata:SWIOrder/sbldata:OrderNumber'"/>
                <xsl:with-param name="IntegrationScenarioName" select="'Sales Order - '"/>
           </xsl:call-template>
           -->
      <corecom:EBMHeader>
      <corecom:EBMID>
      <xsl:value-of select="orcl:generate-guid()"/>
      </corecom:EBMID>
      <corecom:EBMName>
      <xsl:text disable-output-escaping="no">EcoProductEBM</xsl:text>
      </corecom:EBMName>
      <corecom:EBOName>
      <xsl:text disable-output-escaping="no">EcoProductEBO</xsl:text>
      </corecom:EBOName>
      <corecom:CreationDateTime>
      <xsl:value-of select="xp20:current-dateTime()"/>
      </corecom:CreationDateTime>
      <corecom:RequestEBMID>
      <xsl:value-of select="orcl:generate-guid()"/>
      </corecom:RequestEBMID>
      <corecom:VerbCode>
      <xsl:text disable-output-escaping="no">Process</xsl:text>
      </corecom:VerbCode>
      <corecom:Sender>
      <corecom:ID>
      <xsl:text disable-output-escaping="no">Flexcube</xsl:text>
      </corecom:ID>
      </corecom:Sender>
      <corecom:Target>
      <corecom:ID>
      <xsl:text disable-output-escaping="no">SiebelCRM</xsl:text>
      </corecom:ID>
      <corecom:ServiceName>
      <xsl:text disable-output-escaping="no">Ecoproductservice</xsl:text>
      </corecom:ServiceName>
      </corecom:Target>
      </corecom:EBMHeader>
      <ebo:DataArea>
      <!--- Call your data mapping template here
           Sample Data mapping template call
      <xsl:apply-templates select="sbldata:ListOfSWIOrderIO/sbldata:SWIOrder"/>
           -->
      <ebo:EcoSiebel_ProductsRequest>
      <ebo:body>
      <ebo:Products>
      <ebo:STTM_ACCOUNT_CLASS>
      <ebo:ACCOUNT_CLASS>
      <xsl:value-of select="/sibabo:body/sibabo:Products/sibabo:STTM_ACCOUNT_CLASS/sibabo:ACCOUNT_CLASS"/>
      </ebo:ACCOUNT_CLASS>
      <ebo:DESCRIPTION>
      <xsl:value-of select="/sibabo:body/sibabo:Products/sibabo:STTM_ACCOUNT_CLASS/sibabo:DESCRIPTION"/>
      </ebo:DESCRIPTION>
      <ebo:RECORD_STAT>
      <xsl:value-of select="/sibabo:body/sibabo:Products/sibabo:STTM_ACCOUNT_CLASS/sibabo:RECORD_STAT"/>
      </ebo:RECORD_STAT>
      <ebo:AUTH_STAT>
      <xsl:value-of select="/sibabo:body/sibabo:Products/sibabo:STTM_ACCOUNT_CLASS/sibabo:AUTH_STAT"/>
      </ebo:AUTH_STAT>
      </ebo:STTM_ACCOUNT_CLASS>
      <ebo:STTM_BANK>
      <ebo:BANK_NAME>
      <xsl:value-of select="/sibabo:body/sibabo:Products/sibabo:STTM_BANK/sibabo:BANK_NAME"/>
      </ebo:BANK_NAME>
      <ebo:BANK_CODE>
      <xsl:value-of select="/sibabo:body/sibabo:Products/sibabo:STTM_BANK/sibabo:BANK_CODE"/>
      </ebo:BANK_CODE>
      <ebo:PRODUCT_TYPE>
      <xsl:value-of select="/sibabo:body/sibabo:Products/sibabo:STTM_BANK/sibabo:PRODUCT_TYPE"/>
      </ebo:PRODUCT_TYPE>
      <ebo:PRODUCT_CLASS>
      <xsl:value-of select="/sibabo:body/sibabo:Products/sibabo:STTM_BANK/sibabo:PRODUCT_CLASS"/>
      </ebo:PRODUCT_CLASS>
      </ebo:STTM_BANK>
      </ebo:Products>
      </ebo:body>
      </ebo:EcoSiebel_ProductsRequest>
      </ebo:DataArea>
      </ebo:EcoSiebel_ProductsRequestEBM>
      <!--- Sample data mapping template
           
           <xsl:template match="sbldata:SWIOrder">
           </xsl:template>
      -->
      </xsl:template>
      </xsl:stylesheet>

      source.xml

      <?xml version="1.0" encoding="UTF-8" ?>
      <body xmlns="http://xmlns.oracle.com/finan">
      <Products>
      <STTM_ACCOUNT_CLASS>
      <ACCOUNT_CLASS>ACCOUNT_CLASS1</ACCOUNT_CLASS>
      <DESCRIPTION>DESCRIPTION2</DESCRIPTION>
      <RECORD_STAT>RECORD_STAT3</RECORD_STAT>
      <AUTH_STAT>AUTH_STAT4</AUTH_STAT>
      <ACCOUNT_CLASS>ACCOUNT_CLASS5</ACCOUNT_CLASS>
      </STTM_ACCOUNT_CLASS>
      <STTM_BANK>
      <BANK_NAME>BANK_NAME6</BANK_NAME>
      <BANK_CODE>BANK_CODE7</BANK_CODE>
      <PRODUCT_TYPE>PRODUCT_TYPE8</PRODUCT_TYPE>
      <PRODUCT_CLASS>PRODUCT_CLASS9</PRODUCT_CLASS>
      </STTM_BANK>
      </Products>
      </body>

      Thanku,
        • 1. Re: XSLT transformation failed
          vladodias
          Hi,

          You have a template "SenderNode" that is not defined...

          <xsl:call-template name="GetSenderNode"/>

          Cheers,
          Vlad
          • 2. Re: XSLT transformation failed
            972017
            Hi vladodias

            Thanku for responding

            I define this template in xslt plese check my previous thredcode

            <xsl:variable name="Sender">
            <xsl:call-template name="GetSenderNode"/>
            </xsl:variable>
            <xsl:variable name="DVMSourceCol" select="$Sender/corecom:Sender/corecom:ID"/>
            <xsl:variable name="DVMTargetCol">COMMON</xsl:variable>
            <xsl:variable name="XREFSourceCol"

            and when i test ReqstABCS thir i am unable to transform the payload ,after transform activity i get below empty part

            <corecom:Sender>
            <corecom:ID>Flexcube</corecom:ID>
            </corecom:Sender>
            <corecom:Target>
            <corecom:ID>SiebelCRM</corecom:ID>
            <corecom:ServiceName>Ecoproductservice</corecom:ServiceName>
            </corecom:Target>
            </corecom:EBMHeader>
            <ebo:DataArea>
            <ebo:EcoSiebel_ProductsRequest>
            <ebo:body>
            <ebo:Products>
            <ebo:STTM_ACCOUNT_CLASS>
            <ebo:ACCOUNT_CLASS/>
            <ebo:DESCRIPTION/>
            <ebo:RECORD_STAT/>
            </ebo:STTM_ACCOUNT_CLASS>
            <ebo:STTM_BANK>
            <ebo:BANK_NAME/>
            <ebo:PRODUCT_TYPE/>
            <ebo:PRODUCT_CLASS/>
            </ebo:STTM_BANK>
            </ebo:Products>
            </ebo:body>
            </ebo:EcoSiebel_ProductsRequest>
            </ebo:DataArea>
            this ReqstABCS XSLT:
            <?xml version="1.0" encoding="UTF-8" ?>
            <?oracle-xsl-mapper
            <!-- SPECIFICATION OF MAP SOURCES AND TARGETS, DO NOT MODIFY. -->
            <mapSources>
            <source type="WSDL">
            <schema location="../EcoproductDBAdapter.wsdl"/>
            <rootElement name="CxProductsIntTableCollection" namespace="http://xmlns.oracle.com/pcbpel/adapter/db/top/EcoproductDBAdapter"/>
            </source>
            </mapSources>
            <mapTargets>
            <target type="WSDL">
            <schema location="oramds:/apps/AIAMetaData/AIAComponents/EnterpriseBusinessServiceLibrary/Core/EBO/product/V2/EcoProductEBS.wsdl"/>
            <rootElement name="EcoSiebel_ProductsRequestEBM" namespace="http://xmlns.oracle.com/EnterpriseObjects/Core/EBO/product/V2"/>
            </target>
            </mapTargets>
            <!-- GENERATED BY ORACLE XSL MAPPER 11.1.1.6.0(build 111214.0600.1553) AT [WED DEC 12 14:37:15 GMT 2012]. -->
            ?>
            <xsl:stylesheet version="2.0"
            xmlns:top="http://xmlns.oracle.com/pcbpel/adapter/db/top/EcoproductDBAdapter"
            xmlns:svcdoc="http://xmlns.oracle.com/Services/Documentation/V1"
            xmlns:aia="http://www.oracle.com/XSL/Transform/java/oracle.apps.aia.core.xpath.AIAFunctions"
            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:bpel="http://docs.oasis-open.org/wsbpel/2.0/process/executable"
            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
            xmlns:tns="http://xmlns.oracle.com/pcbpel/adapter/db/Ecoproductservice/ProcessEcoproductReqABCSImpl/EcoproductDBAdapter"
            xmlns:ns1="http://xmlns.oracle.com/EnterpriseServices/Core/product/V2"
            xmlns:ns3="http://xmlns.oracle.com/EnterpriseObjects/Core/Custom/EBO/product/V2"
            xmlns:bpm="http://xmlns.oracle.com/bpmn20/extensions"
            xmlns:plt="http://schemas.xmlsoap.org/ws/2003/05/partner-link/"
            xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
            xmlns:ns2="http://xmlns.oracle.com/EnterpriseObjects/Core/Custom/Common/V2"
            xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
            xmlns:ora="http://schemas.oracle.com/xpath/extension"
            xmlns:socket="http://www.oracle.com/XSL/Transform/java/oracle.tip.adapter.socket.ProtocolTranslator"
            xmlns:ns0="http://schemas.xmlsoap.org/ws/2003/03/addressing"
            xmlns:mhdr="http://www.oracle.com/XSL/Transform/java/oracle.tip.mediator.service.common.functions.MediatorExtnFunction"
            xmlns:oraext="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.ExtFunc"
            xmlns:dvm="http://www.oracle.com/XSL/Transform/java/oracle.tip.dvm.LookupValue"
            xmlns:hwf="http://xmlns.oracle.com/bpel/workflow/xpath"
            xmlns:med="http://schemas.oracle.com/mediator/xpath"
            xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
            xmlns:ids="http://xmlns.oracle.com/bpel/services/IdentityService/xpath"
            xmlns:ns5="urn:oasis:names:tc:xacml:2.0:policy:schema:cd:04"
            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:xsd="http://www.w3.org/2001/XMLSchema"
            xmlns:ebs="http://xmlns.oracle.com/EnterpriseServices/Core/EBO/product/V2"
            xmlns:corecom="http://xmlns.oracle.com/EnterpriseObjects/Core/Common/V2"
            xmlns:ebo="http://xmlns.oracle.com/EnterpriseObjects/Core/EBO/product/V2"
            xmlns:ns4="urn:oasis:names:tc:xacml:2.0:context:schema:cd:04"
            xmlns:ldap="http://schemas.oracle.com/xpath/extension/ldap"
            exclude-result-prefixes="xsi xsl top tns plt wsdl xsd svcdoc ns1 ns3 soap ns2 ns0 ns5 ebs corecom ebo ns4 aia bpws xp20 bpel bpm ora socket mhdr oraext dvm hwf med ids xdk xref ldap">
            <xsl:include href="Xform_EcoABMReqMsg_to_EcoproductEBMReqMsg_Custom.xsl"/>
            <xsl:include href="Xform_EcoABMHeader_to_EcoproductEBMHeader.xsl"/>
            <xsl:template match="/">
            <ebo:EcoSiebel_ProductsRequestEBM>
            <corecom:EBMHeader>
            <corecom:EBMID>
            <xsl:value-of select="oraext:generate-guid()"/>
            </corecom:EBMID>
            <corecom:EBMName>
            <xsl:text disable-output-escaping="no">EcoProductEBM</xsl:text>
            </corecom:EBMName>
            <corecom:EBOName>
            <xsl:text disable-output-escaping="no">EcoProductEBO</xsl:text>
            </corecom:EBOName>
            <corecom:CreationDateTime>
            <xsl:value-of select="xp20:current-dateTime()"/>
            </corecom:CreationDateTime>
            <corecom:RequestEBMID>
            <xsl:value-of select="oraext:generate-guid()"/>
            </corecom:RequestEBMID>
            <corecom:VerbCode>
            <xsl:text disable-output-escaping="no">Process</xsl:text>
            </corecom:VerbCode>
            <corecom:Sender>
            <corecom:ID>
            <xsl:text disable-output-escaping="no">Flexcube</xsl:text>
            </corecom:ID>
            </corecom:Sender>
            <corecom:Target>
            <corecom:ID>
            <xsl:text disable-output-escaping="no">SiebelCRM</xsl:text>
            </corecom:ID>
            <corecom:ServiceName>
            <xsl:text disable-output-escaping="no">Ecoproductservice</xsl:text>
            </corecom:ServiceName>
            </corecom:Target>
            </corecom:EBMHeader>
            <ebo:DataArea>
            <ebo:EcoSiebel_ProductsRequest>
            <ebo:body>
            <ebo:Products>
            <ebo:STTM_ACCOUNT_CLASS>
            <ebo:ACCOUNT_CLASS>
            <xsl:value-of select="/top:CxProductsIntTableCollection/top:CxProductsIntTable/top:accountClass"/>
            </ebo:ACCOUNT_CLASS>
            <ebo:DESCRIPTION>
            <xsl:value-of select="/top:CxProductsIntTableCollection/top:CxProductsIntTable/top:productName"/>
            </ebo:DESCRIPTION>
            <ebo:RECORD_STAT>
            <xsl:value-of select="/top:CxProductsIntTableCollection/top:CxProductsIntTable/top:recordStat"/>
            </ebo:RECORD_STAT>
            </ebo:STTM_ACCOUNT_CLASS>
            <ebo:STTM_BANK>
            <ebo:BANK_NAME>
            <xsl:value-of select="/top:CxProductsIntTableCollection/top:CxProductsIntTable/top:introductionDt"/>
            </ebo:BANK_NAME>
            <ebo:PRODUCT_TYPE>
            <xsl:value-of select="/top:CxProductsIntTableCollection/top:CxProductsIntTable/top:type"/>
            </ebo:PRODUCT_TYPE>
            <ebo:PRODUCT_CLASS>
            <xsl:value-of select="/top:CxProductsIntTableCollection/top:CxProductsIntTable/top:productClass"/>
            </ebo:PRODUCT_CLASS>
            </ebo:STTM_BANK>
            </ebo:Products>
            </ebo:body>
            </ebo:EcoSiebel_ProductsRequest>
            </ebo:DataArea>
            </ebo:EcoSiebel_ProductsRequestEBM>
            </xsl:template>
            </xsl:stylesheet>




            Thanku

            Edited by: 969014 on Dec 12, 2012 2:35 AM

            Edited by: 969014 on Dec 12, 2012 8:33 AM
            • 3. Re: XSLT transformation failed
              vladodias
              I define this template in xslt plese check my previous thredcode
              <xsl:call-template name="GetSenderNode"/>
              Here, you're calling the template...

              To define the template you need something like...
              <xsl:template match="/" name="GetSenderNode">