2 Replies Latest reply: Sep 23, 2013 11:56 PM by TanmayS RSS

    xslt copy-of creates a xml which returns empty while trying to access elements using XPATH

    TanmayS

      Hi

       

       

      I am trying to do a copy-of function using the XSLT in jdev. This is what I do

        

          <xsl:param name="appdataDO"/>

          <xsl:template match="/">

          <ns1:applicationData>

            <ns1:applicationId>

              <xsl:value-of select="$appdataDO/ns1:applicationData/ns1:applicationId"/>

            </ns1:applicationId>

            <xsl:copy-of select="/fslo:ExternalapplicationData/fslo:ApplicationsHDRAddInfo">

            </xsl:copy-of>

          </ns1:applicationData>

          </xsl:template>

          </xsl:stylesheet>

       

       

      After this I can see the document created in the process flow as this :

       

       

          <ns1:applicationData>

          <ns1:applicationId>MMMM</ns1:applicationId>

          <ns2:ApplicationsHDRAddInfo>

          <ns3:genericFromBasePrimitive>iuoui</ns3:genericFromBasePrimitive>

          <ns4:EstimatedMarketValue>77</ns4:EstimatedMarketValue>

          <ns4:PropertyInsuranceFee>jih</ns4:PropertyInsuranceFee>

          <ns4:LoanOriginationFee>hjh</ns4:LoanOriginationFee>

          <ns4:RegistrarFee>kkkkk</ns4:RegistrarFee>

          <ns4:LoanCashInFee>hjh</ns4:LoanCashInFee>

          <ns4:LoanPaidInCashFlag>cddffgd</ns4:LoanPaidInCashFlag>

          </ns2:ApplicationsHDRAddInfo>

          </ns1:applicationData>

       

       

       

       

      But whenever I am trying to extract any of the output nodes I am getting an empty result. I can copy the whole dataset into similar kind of variable.

      But I am unable to get individual elements using XPATH.

       

       

      I tried using exslt function for node set and xslt 2.0 without avail.

       

       

      The namespaces might be the culprit here . The test method in the jdev is able to output a result but at runtime the xpath returns empty .

       

       

      I have created another transform where I try to copy data from the precious dataobject to a simple string in another data object .

      This is the test sample source xml for the transform created by jdev while testing with all namespaces, where I try to copy the data in a simple string in another data object.

       

       

          <applicationData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.oracle.com/bpmpa/fs/ulo/types file:/C:/JDeveloper/NewAPP/Xfrm/xsd/ApplicationData.xsd" xmlns="http://xmlns.oracle.com/bpmpa/fs/ulo/types">

             <applicationId>applicationId289</applicationId>

             <ApplicationsHDRAddInfo>

                <genericFromBasePrimitive xmlns="http://xmlns.oracle.com/bpm/pa/extn/types/BasePrimitive">genericFromBasePrimitive290</genericFromBasePrimitive>

                <EstimatedMarketValue xmlns="http://xmlns.oracle.com/bpm/pa/extn/headerCategories/">291</EstimatedMarketValue>

                <PropertyInsuranceFee xmlns="http://xmlns.oracle.com/bpm/pa/extn/headerCategories/">PropertyInsuranceFee292</PropertyInsuranceFee>

                <LoanOriginationFee xmlns="http://xmlns.oracle.com/bpm/pa/extn/headerCategories/">LoanOriginationFee293</LoanOriginationFee>

                <RegistrarFee xmlns="http://xmlns.oracle.com/bpm/pa/extn/headerCategories/">RegistrarFee294</RegistrarFee>

                <LoanCashInFee xmlns="http://xmlns.oracle.com/bpm/pa/extn/headerCategories/">LoanCashInFee295</LoanCashInFee>

                <LoanPaidInCashFlag xmlns="http://xmlns.oracle.com/bpm/pa/extn/headerCategories/">LoanPaidInCashFlag296</LoanPaidInCashFlag>

             </ApplicationsHDRAddInfo>

          </applicationData>

       

       

      And the xslt

       

       

          <xsl:template match="/">

              <ns1:DefaultOutput>

                <ns1:attribute1>

                  <xsl:value-of select="/fslo:applicationData/fslo:ApplicationsHDRAddInfo/custom:LoanOriginationFee"/>

                </ns1:attribute1>

              </ns1:DefaultOutput>

            </xsl:template>

       

       

      This results in a empty attribute1. Any help will be appreciated .