Two conditions using OR in XPATH

前端 未结 4 821
没有蜡笔的小新
没有蜡笔的小新 2020-12-01 13:42

I have a textbox, \'txtSearch\'. I am using it to search people by Last Name. this is my code.

var xmlTempResultSearch = xmlResidentListDisplay.selectNodes(
         


        
4条回答
  •  天命终不由人
    2020-12-01 14:41

    As noted by Michael Kay, no or is necessary.

    Simply use:

    PeopleList/Row
      [contains(translate(@LastName, 
                         'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 
                         'abcdefghijklmnopqrstuvwxyz'), '" 
    +
               translate(txtSearch.value,
                         'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 
                         'abcdefghijklmnopqrstuvwxyz')'" 
    
    + "')]");
    

提交回复
热议问题