@Override
    public int getNamespaceCount() {
        switch(currentEvt){
            case START_ELEMENT:
            case END_ELEMENT:
            	final Iterator<?> it = nsstack.addedForward().iterator();
            	int cnt = 0;
            	while (it.hasNext()) {
            		cnt++;
            		it.next();
            	}
            	return cnt;
        }
        
        throw new IllegalStateException("getNamespaceCount not supported for event " + currentEvt);
    }