code: @Override
      public int getIdAttrIndex()
      {
          // Let's figure out the index only when needed
          int ix = mIdAttrIndex;
          if (ix == -2) {
              ix = -1;
              if (mCurrElem != null) {
                  DTDAttribute idAttr = mCurrElem.getIdAttribute();
                  if (idAttr != null) {
                      DTDAttribute[] attrs = mAttrSpecs;
                      for (int i = 0, len = attrs.length; i < len; ++i) {
                          if (attrs[i] == idAttr) {
                              ix = i;
                              break;
                          }
                      }
                  }
              }
              mIdAttrIndex = ix;
          }
          return ix;
      }
docs: Method for finding out the index of the attribute (collected using
  the attribute collector; having DTD-derived info in same order)
  that is of type ID. DTD explicitly specifies that at most one
  attribute can have this type for any element.
  
  @return Index of the attribute with type ID, in the current
  element, if one exists: -1 otherwise