NamedNodeMap nnm = parent.getAttributes(); int nAttrs = nnm.getLength(); for (int i = 0;  i < nAttrs;  i++)
Node attr = nnm.item(i); String aname = attr.getNodeName(); if (QName.isXMLNSDecl(aname))
  public void processNSDecls(Node src)    throws SAXException  {    int type;    // Vector nameValues = null;    // Vector alreadyProcessedPrefixes = null;    Node parent = src;    while (parent != null           && ((type = parent.getNodeType()) == Node.ELEMENT_NODE               || (type == Node.ENTITY_REFERENCE_NODE)))    {      if (type == Node.ELEMENT_NODE)      {        NamedNodeMap nnm = parent.getAttributes();        int nAttrs = nnm.getLength();        for (int i = 0;  i < nAttrs;  i++)        {          Node attr = nnm.item(i);          String aname = attr.getNodeName();          if (QName.isXMLNSDecl(aname))          {            String prefix = QName.getPrefixFromXMLNSDecl(aname);            String desturi = getURI(prefix);            String srcURI = attr.getNodeValue();            if(!srcURI.equalsIgnoreCase(desturi))            {              this.startPrefixMapping(prefix, srcURI);            }          }        }      }      parent = parent.getParentNode();    }  }