Details
-
Bug
-
Status: Closed
-
High
-
Resolution: Done
-
Honolulu Release, Istanbul Release
-
None
Description
Given a model containing data like below
- /bookstore/category
- /bookstore/category/subcategory
Actual Behavior
==========
currently cpsPath can be used to execute a query with a cpsPath of '//category' which is interpreted as xPath "ends-with the string 'category'"
and it will return both above data elements as the both end in 'category'. Also '//ry' would return the same result
to prevent ambiguity we recommended and have written test with '///category' looking for xPaths that end in '/category' and do NOT match '/subcategory'
Expected Behavior
============
However in XPath preceding '/' is implied and '//category' should only match the whole node identifier. So '//category' will only match '/bookstore/category' and NOT '/bookstore/category/subcategory'. ''//ry' wil match nothing!
using three slashes ('///category') is invalid syntax in xPath
Proposed changes
- When creating the target-string used by ends-with expression in the DB query, prefix it with a singel '/' to get the required results
- (optional) Before creating the target -string check if it starts with a '/' and if so throw an exception that the cpsPath expression is invalid
Attachments
# | Subject | Branch | Project | Status | CR | V |
---|---|---|---|---|---|---|
120563,1 | Fix "ends-with" query syntax to conform with xPath definition | master | cps | Status: MERGED | +2 | +1 |