You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

Requirement

we would like to bring support for contains operator in cps-path. 

contains() is a method in XPath expression. It is used when the value of any attribute changes dynamically, below are the examples,

Reference

CPS-1272


Issues & decisions


#

Issue

Notes 

Decision

1

In this example, we can identify the element by using leaf-name and leaf-value. In this cps-path expression leaf-name=language and leaf-value=english.

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

Examples

  • //books[contains(@language,'english')


2

In this example, we can identify the element by  using partial  value of the attribute. In this cps-path expression partial value ‘en’ is used in place of english.

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

 Examples

  • //books[contains(@language,'en')]

3

In this example, we can identify the element by using text() element and its value. In this cps-path expression leaf-name=language and leaf-value=english.

Syntax: <cps-path> (  contains '[@text(),' <string-value> ']' )

Examples

  • //books/language[contains(@text(),'english')]

  • No labels