コード例 #1
0
  /**
   * Look up the index of an attribute by Namespace name.
   *
   * @param uri The Namespace URI, or the empty string if the name has no Namespace URI.
   * @param localName The attribute's local name.
   * @return The index of the attribute, or -1 if it does not appear in the list.
   */
  public int getIndex(String uri, String localName) {
    Vector attributes;
    int size;
    Attribute attribute;
    String string;
    int ret;

    ret = -1;

    attributes = mTag.getAttributesEx();
    if (null != attributes) {
      size = attributes.size();
      for (int i = 1; i < size; i++) {
        attribute = (Attribute) attributes.elementAt(i);
        string = attribute.getName();
        if (null != string) // not whitespace
        {
          mSupport.processName(string, mParts, true);
          if (uri.equals(mParts[0]) & localName.equalsIgnoreCase(mParts[1])) {
            ret = i;
            i = size; // exit fast
          }
        }
      }
    }

    return (ret);
  }
コード例 #2
0
 /**
  * Look up an attribute's local name by index.
  *
  * @param index The attribute index (zero-based).
  * @return The local name, or the empty string if Namespace processing is not being performed, or
  *     null if the index is out of range.
  * @see #getLength
  */
 public String getLocalName(int index) {
   mSupport.processName(getQName(index), mParts, true);
   return (mParts[1]);
 }
コード例 #3
0
 /**
  * Look up an attribute's value by XML qualified (prefixed) name.
  *
  * <p>See {@link #getValue(int) getValue(int)} for a description of the possible values.
  *
  * @param qName The XML qualified name.
  * @return The attribute value as a string, or null if the attribute is not in the list or if
  *     qualified names are not available.
  */
 public String getValue(String qName) {
   mSupport.processName(qName, mParts, true);
   return (getValue(mParts[0], mParts[1]));
 }
コード例 #4
0
 /**
  * Look up the index of an attribute by XML qualified (prefixed) name.
  *
  * @param qName The qualified (prefixed) name.
  * @return The index of the attribute, or -1 if it does not appear in the list.
  */
 public int getIndex(String qName) {
   mSupport.processName(qName, mParts, true);
   return (getIndex(mParts[0], mParts[1]));
 }