code: private Integer getNonSpecialAttrLength(NamedNodeMap attributes) {
          int length = 0, maxLength = attributes.getLength();
          for (int i = 0; i < maxLength; ++i) {
              Attr a = (Attr) attributes.item(i);
              if (!isXMLNSAttribute(a)
                  && !isRecognizedXMLSchemaInstanceAttribute(a)) {
                  ++length;
              }
          }
          return new Integer(length);
      }
docs: The number of attributes not related to namespace declarations
  and/or Schema location.