How to use like in XPath?

后端 未结 3 1645
轮回少年
轮回少年 2021-01-02 02:20

I have a page that searches with filters. I have this code for example,

xmlTempResultSearch = xmlResidentListDisplay.selectNodes(\"//PeopleList/Row[@LastName         


        
3条回答
  •  说谎
    说谎 (楼主)
    2021-01-02 03:00

    You can use all of the XPath (1.0) string functions. If you have XPath 2.0 available, then you can even use RegEx.

    contains()

    starts-with()

    substring()

    substring-before()

    substring-after()

    concat()

    translate()

    string-length()

    There is no **ends-with() in XPath 1.0, but it can easily be expressed with this XPath 1.0 expression**:

    substring($s, string-length($s) - string-length($t) +1) = $t
    

    is true() exactly when the string $s ends with the string $t.

提交回复
热议问题