Should this be checking *path=='['?  Can anything else occur next for a valid extra filter.

What about

abc[@x="3"/def[@y="2"]

will it skip over the '/'?