cancel
Showing results for 
Search instead for 
Did you mean: 

assign XML to property variable in HCI

yatanveersingh
Active Participant
0 Kudos

Hi Guys,

I went through the blocks which tells how to assign property from XSLT in HCI.

However I want to know how can we do some transformation in XSLT and then assign that

output to the property variable in HCI.

<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet version="1.0"
               xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:plnk="http://docs.oasis-open.org/wsbpel/2.0/plnktype"
                xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
                xmlns:hci="http://sap.com/it/">
                <xsl:param name="exchange"/>
  <xsl:template match="/">
    <Emp>
      <xsl:for-each select="/Employees/Employee">
        <EmpDetails>
          <CEE_ID>
            <xsl:value-of select="CEE_ID"/>
          </CEE_ID>
        </EmpDetails>
      </xsl:for-each>
    </Emp>
    <xsl:value-of select="hci:setProperty($exchange, 'EMP', <HOW TO ADD XSLT OUTPUT HERE ???> />
  </xsl:template>
</xsl:stylesheet>

Thanks

Yatan

Accepted Solutions (0)

Answers (3)

Answers (3)

former_member223322
Active Participant
0 Kudos

Hi Yatanveer,

You need to declare a local variable first and pass the whole XML payload. Then just use this variable in the setProperty as below.

<xsl:variable name="xml_inp">
<xsl:copy-of select="."/>
</xsl:variable>

<xsl:value-ofselect="hci:setProperty($exchange, 'EMP', $xml_inp) />

Try it out.

~Srini

yatanveersingh
Active Participant
0 Kudos

Basically if I want to set the whole XML in property variable.

former_member223322
Active Participant
0 Kudos

Are you trying to assign the CEE_ID value in the setProperty?

~Srini