Пример #1
0
  /**
   * This method is called for the end tag of the root document tag. If there are name spaces, they
   * would have been defined in this tag. Insert them in the front of the attribute list.
   *
   * @throws XmlPullParserException
   */
  private void addNamespaces(int depth) throws XmlPullParserException {
    TagNode tag = (TagNode) mDocumentTag;
    AttributeList attrList = tag.getAttrList();

    int nsStart = mParser.getNamespaceCount(depth - 1);
    int nsEnd = mParser.getNamespaceCount(depth);
    for (int i = nsEnd - 1; i >= nsStart; i--) {
      Attribute attr = buildNS(i);
      attrList.insert(attr);
    }
  } // addNamespaces