code: XSLTAttributeDef getAttributeDef(String uri, String localName)
    {
  
      XSLTAttributeDef defaultDef = null;
      XSLTAttributeDef[] attrDefs = getAttributes();
      int nAttrDefs = attrDefs.length;
  
      for (int k = 0; k < nAttrDefs; k++)
      {
        XSLTAttributeDef attrDef = attrDefs[k];
        String uriDef = attrDef.getNamespace();
        String nameDef = attrDef.getName();
        
        if (nameDef.equals("*") && (equalsMayBeNullOrZeroLen(uri, uriDef) || 
            (uriDef != null && uriDef.equals("*") && uri!=null && uri.length() > 0 )))
        {
          return attrDef;
        }
        else if (nameDef.equals("*") && (uriDef == null))
        {
  
          // In this case, all attributes are legal, so return 
          // this as the last resort.
          defaultDef = attrDef;
        }
        else if (equalsMayBeNullOrZeroLen(uri, uriDef)
                 && localName.equals(nameDef))
        {
          return attrDef;
        }
      }
  
      if (null == defaultDef)
      {
        if (uri.length() > 0 && !equalsMayBeNullOrZeroLen(uri, Constants.S_XSLNAMESPACEURL))
        {
          return XSLTAttributeDef.m_foreignAttr;
        }
      }
  
      return defaultDef;
    }
docs: Given a namespace URI, and a local name, return the element's
  attribute definition, if it has one.
  
  @param uri The Namespace URI, or an empty string.
  @param localName The local name (without prefix), or empty string if not namespace processing.
  
  @return The attribute def that matches the arguments, or null.