public int startElement(QName qn, Attributes attributes) { int nodeNr = doc.addNode(Node.ELEMENT_NODE, level, qn);  String attrPrefix; String attrLocalName; String attrNS; String attrQName; int p; for (int i = 0; i < attributes.getLength(); i++) { attrNS = attributes.getURI(i); attrLocalName = attributes.getLocalName(i); attrQName = attributes.getQName(i);  if (!(attrQName.startsWith("xmlns") || attrNS.equals("http: p = attrQName.indexOf(':'); attrPrefix = (p > -1) ? attrQName.substring(0, p) : null; p = doc.addAttribute( nodeNr, new QName(attrLocalName, attrNS, attrPrefix), attributes.getValue(i)); }
public int startElement( String namespaceURI, String localName, String qname, Attributes attributes) { int p = qname.indexOf(':'); String prefix = null; if(context != null) { prefix = context.getPrefixForURI(namespaceURI);
	public int startElement(QName qn, Attributes attributes) {		int nodeNr = doc.addNode(Node.ELEMENT_NODE, level, qn);		// parse attributes		String attrPrefix;		String attrLocalName;		String attrNS;		String attrQName;		int p;		for (int i = 0; i < attributes.getLength(); i++) {			attrNS = attributes.getURI(i);			attrLocalName = attributes.getLocalName(i);			attrQName = attributes.getQName(i);			// skip xmlns-attributes and attributes in eXist's namespace			if (!(attrQName.startsWith("xmlns")				|| attrNS.equals("http://exist.sourceforge.net/NS/exist"))) {				p = attrQName.indexOf(':');				attrPrefix = (p > -1) ? attrQName.substring(0, p) : null;				p =					doc.addAttribute(						nodeNr,						new QName(attrLocalName, attrNS, attrPrefix),						attributes.getValue(i));			}		}		// update links		if (level + 1 >= prevNodeInLevel.length) {			int[] t = new int[level + 2];			System.arraycopy(prevNodeInLevel, 0, t, 0, level);			prevNodeInLevel = t;		}		int prevNr = prevNodeInLevel[level];		if (prevNr > -1)			doc.next[prevNr] = nodeNr;		doc.next[nodeNr] = prevNodeInLevel[level - 1];		prevNodeInLevel[level] = nodeNr;		++level;		return nodeNr;	}