Forum Discussion

Usha_Kodali's avatar
Usha_Kodali
Frequent Contributor
17 years ago

[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

  • 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
  • Usha_Kodali's avatar
    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.
  • 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
  • Usha_Kodali's avatar
    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.