Ask a Question

[RESOLVED] extract data from nodes depending on the condition

Usha_Kodali
Frequent Contributor

[RESOLVED] extract data from nodes depending on the condition

Hi,
In the below response, I want to search for Commentary and then if I find it assert that its commentary and then extract ID,SpotID and then  i need to pass as input to another request
I have such nodes with variety other than commentary and there could be more than one commentary elements with different ID and SpotID.


                  4
                 
                     

                     true
                     
                 

                 
                  2009-10-15T16:00:53.3833256-04:00
                 
                  2009-10-15T16:00:53.3833256-04:00
                  faceoff_u3rd_logo_1
                 
                     
                        1
                        18
                        commentary ------- This is what i need to assert.
                        logo_soundoff_1
                     

                 

                  1
                  Primary
                  83
                  -40
                  83
                  190
                  107
                  1
               


Attaching the whole response
15 REPLIES 15
Usha_Kodali
Frequent Contributor

Hi,
i tried it dint work....i am getting ID value but not SpotID value.

what should I give property name for SpotID?
Usha_Kodali
Frequent Contributor

I am not getting second column path value.
SmartBear_Suppo
SmartBear Alumni (Retired)

Hello,

based on response you sent:
row:


declare namespace aetgt='http://musicchoice.com/services/games';
//aetgt:GetSpotListsResponse/aetgt:GetSpotListsResult/aetgt:spotlists/aetgt:Spotlist/aetgt:Spots/aetgt:Spot[aetgt:Variety='commentary']



and:



../../aetgt:ID/text()
aetgt:SpotID/text()




Does it help,
robert

Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
Usha_Kodali
Frequent Contributor

Hi Robert,
I tried but still no luck!

It gives me the value of
../../aetgt:ID/text()
It doesnt go to aetgt:SpotID/text() line.
SmartBear_Suppo
SmartBear Alumni (Retired)

Hi ,

this example that Robert makes really works. Could you please check if you've done something wrong.
I've attached a screenshot.

Best regards
Nebojsa

Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
Usha_Kodali
Frequent Contributor

Hi,
Sorry for the trouble...its working....there was space between aetgt and SpotID...thats why it dint work...
now its working perfectly.
I was using  aetgt: SpotID/text() instead of aetgt:SpotID/text()

Thank you very much for the help.
cancel
Showing results for 
Search instead for 
Did you mean: