Code example for Attributes

Methods: getIndex

0
   * @return The index of the attribute, or -1 if it does not appear in the 
   *         list. 
   */ 
  public int getIndex(final String uri, final String localName)
  { 
    final int idx = attributes.getIndex(uri, localName);
    if (idx >= 0)
    { 
      return idx;
    } 
    if (defaultNSUri.equals(uri))
    { 
      final int index = attributes.getIndex("", localName);
      if (index != -1)
      { 
        return index;
      } 
      try 
      { 
        final int value2 = attributes.getIndex(null, localName);
        if (value2 != -1)
        { 
          return value2;
        } 
      } 
      catch (Exception e)
      { 
        // ignore. Heck, Xerces breaks the SAX-Specs so we have to take weird steps to mess around their mess. 
      } 
 
      return attributes.getIndex(localName);
    } 
    return -1; 
  } 
 
  /**