1

私はこのxpathを持っています:

//a[ substring-after( substring-before( @href , '.deviantart.com' ) , 'http://' ) != 'about' and substring-after( substring-before( @href , '.deviantart.com' ) , 'http://' ) != 'browse' and substring-after( substring-before( @href , '.deviantart.com' ) , 'http://' ) != 'chat' ]

そして、私はこのようなことができるようにしたい:

//a[ substring-after( substring-before( @href , '.deviantart.com' ) , 'http://' ) != [ 'about' , 'browse' , 'chat' ] ]

これを行う方法はありますか?

4

1 に答える 1

0

xpath2 で行くことができます

//a[not( substring-after( substring-before( @href , '.deviantart.com' ) , 'http://' ) 
     = ('about' , 'browse' , 'chat' )) ]

純粋な xpath1 ではかなり制限されますが、xslt や xpath 変数を定義できるその他のコンテキストを使用している場合は、おそらくもう少しきれいにすることができます。

于 2012-03-24T23:41:59.000 に答える