in reply to Need help for Xpath patterns
Why limited to xpath pattern?
Using xsh2, which I hate :) the following works
$ cat jonk.xml <a> <b> <c>not match this</c> </b> <b> <c>but match this</c> </b> </a> $ cat jonk.xsh open "jonk.xml"; #~ foreach /a/b/c { foreach //c { if xsh:matches( text(), '\b\s{2,}\b' ) { pwd; echo text(); } } $ xsh -q jonk.xsh /a/b[2]/c but match this
See XSH2 Reference, Flow control
|
|---|