tags:

views:

19

answers:

2

I have a xpath expression that returns a list of urls that are in a table. I now need a way to remove the first tr, is this possible using one xpath expression? FYI the expression looks like this:

form[@id='form1']/div[@id='cont']/div[@id='mycont']/div[@id='holder']/div[@id='resultslist']/div[2]/table//tr/td[2]/a/@href

The relevant tr is in bold. I'm coding in php which doesn't support xpath 2 afaik.

A: 

tr[preceding-sibling::tr]

Wrikken
+1  A: 
form[@id='form1']
 /div[@id='cont']
  /div[@id='mycont']
   /div[@id='holder']
    /div[@id='resultslist']
     /div[2]
      /table
       //tr[position() > 1]
        /td[2]/a/@href
Alejandro
This worked exactly as intended!
Fnordian Knot