This fixes queries with an attribute filter in the middle, such as //book[@id='bk102']/title. Close #3089