public int findNodeType(int axis, Object test) {
        if (test == null) {  // *
            return (axis == Axis.ATTRIBUTE) ?
                NodeTest.ATTRIBUTE :
                (axis == Axis.NAMESPACE) ? -1 : NodeTest.ELEMENT;
        }
        else if (test instanceof Integer) {
            return ((Integer)test).intValue();
        }
        else {
            QName name = (QName)test;

            if (axis == Axis.NAMESPACE) {
                return (name.toString().equals("*")) ? -1
                    : _xsltc.registerNamespacePrefix(name);
            }

            if (name.getNamespace() == null) {
                final String local = name.getLocalPart();

                if (local.equals("*")) {
                    return (axis == Axis.ATTRIBUTE) ? NodeTest.ATTRIBUTE
                        : NodeTest.ELEMENT;
                }
                else if (local.equals("@*")) {
                    return NodeTest.ATTRIBUTE;
                }
            }

            return (axis == Axis.ATTRIBUTE) ? _xsltc.registerAttribute(name)
                : _xsltc.registerElement(name);
        }
    }