Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

XSLT Transformation for nested xml

I am trying to convert xml into soap request using XSLT transformation policy

XML:-

<Root>
  <reservationItem>
    <hotelName>
      <date>2022-03-09</date>
      <bookingDetails>
        <baseAmount>20000</baseAmount>
        <discAmount>10000</discAmount>
        <season>Prime</season>
      </bookingDetails>
    </hotelName>
    <hotelName>
      <date>2022-03-10</date>
      <bookingDetails>
        <baseAmount>20000</baseAmount>
        <discAmount>10000</discAmount>
        <season>Prime</season>
      </bookingDetails>
    </hotelName>
  </reservationItem>
</Root>

After applying below XSLT

<xsl:if test="Root/reservationItem/hotelName">
     <xsl:for-each select="Root/reservationItem/hotelName">
         <v1:hotelName>
            <xsl:value-of select="." />
         </v1:hotelName>
     </xsl:for-each>
</xsl:if>



getting below result (some ID instead of xml structure)
<v1:hotelName>3151RTN4nullUSD19.0</v1:hotelName>
<v1:hotelName>2022-03-092000010000167750585Prime</v1:hotelName>

@anil

0 1 804
1 REPLY 1