Forum Discussion

rameshsoapui's avatar
rameshsoapui
Contributor
11 years ago

xquery help

Hi

 

I am using this xquery, which is not working any idea ?   please help me..

 

declare namespace soapenv='http://schemas.xmlsoap.org/soap/envelope/';
<Results>
{
for $x in //TEST_RESP/Response/NameList/Names/NameList
    where fn:contains({$x/Names/SimpleValue/@Value}, " Date: 12/20/2013 ")
   return <Names>{$x}</Names>
 
}
</Results>

6 Replies

  • nmrao's avatar
    nmrao
    Icon for Champion Level 1 rankChampion Level 1

    Can you explain with an example? Unless if there is no information like what is the response you were trying on, what is happening currently it is verfy difficult to assume and provide you answer. 

    • rameshsoapui's avatar
      rameshsoapui
      Contributor

      <TEST_RESP TimeStamp="2/13/2015 9:23AM GMT-05:00" version="1.0" Version="x.0.0.179">
      <Response Status="Success" Action="getResults">
      <NameList PropertyName="RecordList">
      <Names>
      <NameList PropertyName="Record">
      <Names>
      <SimpleValue Value=" Date: 12/20/2013 "/>
      <SimpleValue Value="Name: Balance Reset Transaction "/>
      <SimpleValue Value="Actual Amount: null "/>
      <SimpleValue Value="Change: 0.0 "/>
      <SimpleValue Value="Total: 2.0 "/>
      <SimpleValue Value="Balance Type: Ref Date Points "/>
      <SimpleValue Value="Source Policy: null "/>
      <SimpleValue Value="Perfect Disqualification: false"/>
      </Names>
      </NameList>

       

       

      I have XML structure like above, I would like to find/query based on SimpleValue contains a date(12/30/2013 )
      and will return all Names elements

      • nmrao's avatar
        nmrao
        Icon for Champion Level 1 rankChampion Level 1
        Xml snippet you posted does not seem to be welformed.