how can i express in xpath
a) need select elements which contains specified keyword. (how to make it case insensitive?)
z/x/c/v/a[normalize-space(text())='keyword']
b) need to select elements which contains any of given text() (case 开发者_如何学JAVAinsensitive?)
z/x/c/v/a[normalize-space(text())='keyword|keyword2|keyword3']
Lastly,
a) how to express the node's innerHTML ?
z/x/c/v/a[normalize-space(text())='keyword'].innerHTML ?
NOTE: i am using a html parser.
There is no direct way to do case insensitive lookup in XSL. You need to convert the data in lower case or upper case and then do the lookup.
You can use the translate function to do that, something like this translate(text(), ‘ABCDEFGHIJKLMNOPQRSTUVWXYZ’, ‘abcdefghijklmnopqrstuvwxyz’), this will convert the data to lower case.
Not sure if lower-case or upper-case kind of function are available now.
精彩评论