if(!XMLChar.isValidNCName(nextId)) throw new XPathException(nextId + " is not a valid NCName"); QName id = new QName(nextId, "", null); getId((NodeSet)result, docs, id);
if(XMLChar.isValidNCName(nextId)) { QName id = new QName(nextId, "", null); getId((NodeSet)result, docs, id); }
	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 (getArgumentCount() < 1)			throw new XPathException("function id requires one argument");		        if(contextItem != null)			contextSequence = contextItem.toSequence();		        Sequence result;        Expression arg = getArgument(0);        		Sequence idval = arg.eval(contextSequence);		if(idval.isEmpty())            result = Sequence.EMPTY_SEQUENCE;        else {    		result = new ExtArrayNodeSet();    		String nextId;    		DocumentSet docs;    		if(contextSequence == null || !(contextSequence instanceof NodeSet))    			docs = context.getStaticallyKnownDocuments();    		else    			docs = contextSequence.toNodeSet().getDocumentSet();     		for(SequenceIterator i = idval.iterate(); i.hasNext(); ) {    			nextId = i.nextItem().getStringValue();    			if(nextId.indexOf(" ") != Constants.STRING_NOT_FOUND) {    				// parse idrefs    				StringTokenizer tok = new StringTokenizer(nextId, " ");    				while(tok.hasMoreTokens()) {    					nextId = tok.nextToken();    					if(!XMLChar.isValidNCName(nextId))    						throw new XPathException(nextId + " is not a valid NCName");    					QName id = new QName(nextId, "", null);    					getId((NodeSet)result, docs, id);    				}    			} else {    				if(!XMLChar.isValidNCName(nextId))    					throw new XPathException(nextId + " is not a valid NCName");    				QName id = new QName(nextId, "", null);    				getId((NodeSet)result, docs, id);    			}    		}        }                if (context.getProfiler().isEnabled())             context.getProfiler().end(this, "", result);                 return result;           	}