Forum Discussion

Jayakumarcs's avatar
Jayakumarcs
New Contributor
15 years ago

Property Transfer - Transfering one complete node

Hello,
I am trying to tranfer one element from a response XML to the subsequent request XML using the Property Transfer using XPath.
I have the following piece of XML.
<PricedItinerary SequenceNumber="2">
....<AirItineraryPricingInfo>
........<PTC_FareBreakdowns>
............<PTC_FareBreakdown>
................<PassengerTypeQuantity Quantity="2" Code="ADT"/>
................<FareBasisCodes>
....................<FareBasisCode FlightSegmentRPH="2">M</FareBasisCode>
....................<FareBasisCode FlightSegmentRPH="4">N</FareBasisCode>
....................<FareBasisCode FlightSegmentRPH="6">O</FareBasisCode>
................</FareBasisCodes>
............</PTC_FareBreakdown>
........</PTC_FareBreakdowns>
....</AirItineraryPricingInfo>
</PricedItinerary>


I am trying to copy the complete element <FareBasisCode FlightSegmentRPH="4">N</FareBasisCode> to the next XML.

I tried the following.
1) //PricedItinerary[1]/AirItineraryPricingInfo[1]/PTC_FareBreakdowns[1]/PTC_FareBreakdown[1]/FareBasisCodes[1]/FareBasisCode[@FlightSegmentRPH="4"][1]
This one returns "N", the value of the node.
2)//PricedItinerary[1]/AirItineraryPricingInfo[1]/PTC_FareBreakdowns[1]/PTC_FareBreakdown[1]/FareBasisCodes[1]
or
//PricedItinerary[1]/AirItineraryPricingInfo[1]/PTC_FareBreakdowns[1]/PTC_FareBreakdown[1]/FareBasisCodes[ns1:FareBasisCode/@FlightSegmentRPH="4"][1]

Both returns all three child elements of FareBasisCodes:
<FareBasisCode FlightSegmentRPH="2">M</FareBasisCode>
<FareBasisCode FlightSegmentRPH="4">N</FareBasisCode>
<FareBasisCode FlightSegmentRPH="6">O</FareBasisCode>


Can you please help me with the XPath for getting the element <FareBasisCode FlightSegmentRPH="4">N</FareBasisCode> alone?

Thanks in advance!

1 Reply

  • Solved it!.
    Just uncheck the two options:
    1. Transfer Text Content
    2. Transfer Child Nodes