Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

#

Issue

Notes

Decisions
1Which keyword to use ? Do we want case sensitivity or not? Do we follow the Xpath contains or do we become specific?
  • like %en% 
  • ilike %En% 
  • like 'en' 


  As per discussion , with Toine Siebelink  Prefers Contains Xpath is case sensitive , So ilike keyword would be suitable to implement the contains query , community call  like keyword would has consistency which support case sensitive attribute values.

Need to discuss with stakeholders.

  As per discussion in community call , decided to go with like  keyword more consistent support case sensitivity.


#

Json Data

CPS-PATH Syntax

Output

1

Below is the sample data ,
 Here  are ways  to use contains keyword :
Code Block
titleJson data
collapsetrue
{
   "test:bookstore":{
      "bookstore-name": "Chapters",
      "categories": [
         {
            "code": "01",
            "name": "SciFi",
            "books": [
               {
                  "authors": [
                     "Iain M. Banks"
                  ],
                  "lang": "english",
                  "price": "895",
                  "pub_year": "1994",
                  "title": "Feersum Endjinn"
               }
            ]
         },
         {
            "name": "kids",
            "code": "02",
            "books": [
               {
                  "authors": [
                     "Philip Pullman"
                  ],
                  "lang": "Science",
                  "price": "699",
                  "pub_year": "1995",
                  "title": "The Golden Compass"
               }
            ]
         }
    ]
   }
}


<cps-path>(contains'[@leafname,'<string-value>']')

Examples
  • //books[contains(@lang,'en')
  • //books[contains(@pub_year,'99')


Code Block
titleJson Response
collapsetrue
{
 "lang": "en", 
 "price": 895, 
 "title": "Feersum Endjinn", 
 "authors": [
            "Iain M. Banks"
 ], 
"pub_year":1994
}  
{
 "lang": "en", 
 "price": 699, 
 "title": "The Golden Compass", 
 "authors": [
           "Philip Pullman"
 ], 
"pub_year":1995
}            

                                                                                                    
                                                                                       

...