1

I have this 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' ]

and I want to be able to do something like this:

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

Is there any way to do this?

Iulian Onofrei
  • 9,188
  • 10
  • 67
  • 113

1 Answers1

0

In xpath2 you can go

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

in pure xpath1 you are rather more limited, although if you are using xslt or some other context where you can define xpath variables you could probably make it a bit neater.

David Carlisle
  • 5,582
  • 1
  • 19
  • 23