nsSupport.declarePrefix(prefix, namespaceURI);
nsSupport.declarePrefix(prefix, uri);
	public void startElement(		String namespaceURI,		String localName,		String qname,		Attributes attribs)		throws SAXException {		try {			namespaceDecls.clear();			nsSupport.pushContext();			receiver.startElement(qname);			String prefix = "";			int p = qname.indexOf(':');			if (p > 0)				prefix = qname.substring(0, p);			if (namespaceURI == null)				namespaceURI = "";			if (nsSupport.getURI(prefix) == null) {				namespaceDecls.put(prefix, namespaceURI);				nsSupport.declarePrefix(prefix, namespaceURI);			}			// check attributes for required namespace declarations			String attrName;			String uri;			for (int i = 0; i < attribs.getLength(); i++) {				attrName = attribs.getQName(i);				if (attrName.equals("xmlns")) {					if (nsSupport.getURI("") == null) {						uri = attribs.getValue(i);						namespaceDecls.put("", uri);						nsSupport.declarePrefix("", uri);					}				} else if (attrName.startsWith("xmlns:")) {					prefix = attrName.substring(6);					if (nsSupport.getURI(prefix) == null) {						uri = attribs.getValue(i);						namespaceDecls.put(prefix, uri);						nsSupport.declarePrefix(prefix, uri);					}				} else if ((p = attrName.indexOf(':')) > 0) {					prefix = attrName.substring(0, p);					uri = attribs.getURI(i);					if (nsSupport.getURI(prefix) == null) {						namespaceDecls.put(prefix, uri);						nsSupport.declarePrefix(prefix, uri);					}				}			}			Map.Entry nsEntry;			for (Iterator i = optionalNamespaceDecls.entrySet().iterator();				i.hasNext();			) {				nsEntry = (Map.Entry) i.next();				prefix = (String) nsEntry.getKey();				uri = (String) nsEntry.getValue(); 				receiver.namespace(prefix, uri);				nsSupport.declarePrefix(prefix, namespaceURI);			}			// output all namespace declarations			for (Iterator i = namespaceDecls.entrySet().iterator();				i.hasNext();				) {				nsEntry = (Map.Entry) i.next();				prefix = (String) nsEntry.getKey();				uri = (String) nsEntry.getValue(); 				if(!optionalNamespaceDecls.containsKey(prefix)) {					receiver.namespace(prefix, uri);				}			}			optionalNamespaceDecls.clear();			// output attributes			for (int i = 0; i < attribs.getLength(); i++) {				if (!attribs.getQName(i).startsWith("xmlns"))					receiver.attribute(						attribs.getQName(i),						attribs.getValue(i));			}		} catch (TransformerException e) {			throw new SAXException(e.getMessage(), e);		}	}