PrincipalType () { final XPathStep step = getStep(); final XPathAxisSpecifier axisSpecifier = step.getAxisSpecifier(); if (axisSpecifier == null) return PrincipalType.UNKNOWN; final Axis axis = axisSpecifier.getAxis(); if (axis == Axis.ATTRIBUTE) { return PrincipalType.ATTRIBUTE; } else if (axis == Axis.NAMESPACE) { return PrincipalType.NAMESPACE; } else { return PrincipalType.ELEMENT; } }