[bugfix] Fix ancestor axis selection on in-memory attribute nodes