switch(n.getNodeType()) { case Node.ELEMENT_NODE: case Node.ATTRIBUTE_NODE: result = new AnyURIValue(n.getNamespaceURI()); break;  default:  LOG.warn("Tried to obtain namespace URI for node type " + n.getNodeType()); result = AnyURIValue.EMPTY_URI; }
result = new AnyURIValue(n.getNamespaceURI());
	public Sequence eval(Sequence contextSequence, Item contextItem) throws XPathException {        if (context.getProfiler().isEnabled()) {            context.getProfiler().start(this);                   context.getProfiler().message(this, Profiler.DEPENDENCIES, "DEPENDENCIES", Dependency.getDependenciesName(this.getDependencies()));            if (contextSequence != null)                context.getProfiler().message(this, Profiler.START_SEQUENCES, "CONTEXT SEQUENCE", contextSequence);            if (contextItem != null)                context.getProfiler().message(this, Profiler.START_SEQUENCES, "CONTEXT ITEM", contextItem.toSequence());        }                if(contextItem != null)            contextSequence = contextItem.toSequence();		//if (contextSequence == null)		//	throw new XPathException(getASTNode(), "XPDY0002: Undefined context item");                        Sequence result;        Item item = null;        // check if the node is passed as an argument or should be taken from        // the context sequence        if(getArgumentCount() > 0) {            Sequence seq = getArgument(0).eval(contextSequence);            if(!seq.isEmpty())                item = seq.itemAt(0);        } else {         	if (contextSequence == null)        		throw new XPathException(getASTNode(), "XPDY0002: Undefined context item");            if(!contextSequence.isEmpty())            	throw new XPathException(getASTNode(), "XPDY0002: Undefined context item");            item = contextSequence.itemAt(0);        }                if(item == null)            result = AnyURIValue.EMPTY_URI;        else {        	            if(!Type.subTypeOf(item.getType(), Type.NODE))                throw new XPathException(getASTNode(), "XPDY0004: Context item is not a node; got: " +                        Type.getTypeName(item.getType()));            //TODO : how to improve performance ?            Node n = ((NodeValue)item).getNode();            switch(n.getNodeType()) {                case Node.ELEMENT_NODE:                case Node.ATTRIBUTE_NODE:                	                    result = new AnyURIValue(n.getNamespaceURI());                    break;                //TODO : what kind of default do we expect here ? -pb                default:                	//TODO : raise an exception ?                	LOG.warn("Tried to obtain namespace URI for node type " + n.getNodeType());                    result = AnyURIValue.EMPTY_URI;            }        }                if (context.getProfiler().isEnabled())             context.getProfiler().end(this, "", result);                 return result;          	}