Easy way to transform XPath with contains to equals check? -
is there easy way transform xpath query (as string), like:
my/x/path[contains(sub/path, 'text')] to xpath query uses equals instead of contains? such can use same query, 1 time contains , time equals? unfortunately there no "equals" function in xpath...
you might differentiate between 2 options via flag:
my/x/path[ ($wantcontains , contains(sub/path, 'text')) or (not($wantcontains) , sub/path = 'text') ]
Comments
Post a Comment