src/plugin/parse-html/src/java/org/apache/nutch/parse/html/DOMBuilder.java [271:349]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      elem = m_doc.createElementNS(null, name);
    else
      elem = m_doc.createElementNS(ns, name);

    append(elem);

    try {
      int nAtts = atts.getLength();

      if (0 != nAtts) {
        for (int i = 0; i < nAtts; i++) {

          // System.out.println("type " + atts.getType(i) + " name " +
          // atts.getLocalName(i) );
          // First handle a possible ID attribute
          if (atts.getType(i).equalsIgnoreCase("ID"))
            setIDAttribute(atts.getValue(i), elem);

          String attrNS = atts.getURI(i);

          if ("".equals(attrNS))
            attrNS = null; // DOM represents no-namespace as null

          // System.out.println("attrNS: "+attrNS+", localName: "+atts.getQName(i)
          // +", qname: "+atts.getQName(i)+", value: "+atts.getValue(i));
          // Crimson won't let us set an xmlns: attribute on the DOM.
          String attrQName = atts.getQName(i);

          // In SAX, xmlns: attributes have an empty namespace, while in DOM
          // they should have the xmlns namespace
          if (attrQName.startsWith("xmlns:"))
            attrNS = "http://www.w3.org/2000/xmlns/";

          // ALWAYS use the DOM Level 2 call!
          elem.setAttributeNS(attrNS, attrQName, atts.getValue(i));
        }
      }

      // append(elem);

      m_elemStack.push(elem);

      m_currentNode = elem;

      // append(elem);
    } catch (java.lang.Exception de) {
      // de.printStackTrace();
      throw new org.xml.sax.SAXException(de);
    }

  }

  /**
   * 
   * 
   * 
   * Receive notification of the end of an element.
   * 
   * <p>
   * The SAX parser will invoke this method at the end of every element in the
   * XML document; there will be a corresponding startElement() event for every
   * endElement() event (even when the element is empty).
   * </p>
   * 
   * <p>
   * If the element name has a namespace prefix, the prefix will still be
   * attached to the name.
   * </p>
   * 
   * 
   * @param ns
   *          the namespace of the element
   * @param localName
   *          The local part of the qualified name of the element
   * @param name
   *          The element name
   */
  public void endElement(String ns, String localName, String name)
      throws org.xml.sax.SAXException {
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



src/plugin/parse-tika/src/java/org/apache/nutch/parse/tika/DOMBuilder.java [279:357]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      elem = m_doc.createElementNS(null, name);
    else
      elem = m_doc.createElementNS(ns, name);

    append(elem);

    try {
      int nAtts = atts.getLength();

      if (0 != nAtts) {
        for (int i = 0; i < nAtts; i++) {

          // System.out.println("type " + atts.getType(i) + " name " +
          // atts.getLocalName(i) );
          // First handle a possible ID attribute
          if (atts.getType(i).equalsIgnoreCase("ID"))
            setIDAttribute(atts.getValue(i), elem);

          String attrNS = atts.getURI(i);

          if ("".equals(attrNS))
            attrNS = null; // DOM represents no-namespace as null

          // System.out.println("attrNS: "+attrNS+", localName: "+atts.getQName(i)
          // +", qname: "+atts.getQName(i)+", value: "+atts.getValue(i));
          // Crimson won't let us set an xmlns: attribute on the DOM.
          String attrQName = atts.getQName(i);

          // In SAX, xmlns: attributes have an empty namespace, while in DOM
          // they should have the xmlns namespace
          if (attrQName.startsWith("xmlns:"))
            attrNS = "http://www.w3.org/2000/xmlns/";

          // ALWAYS use the DOM Level 2 call!
          elem.setAttributeNS(attrNS, attrQName, atts.getValue(i));
        }
      }

      // append(elem);

      m_elemStack.push(elem);

      m_currentNode = elem;

      // append(elem);
    } catch (java.lang.Exception de) {
      // de.printStackTrace();
      throw new org.xml.sax.SAXException(de);
    }

  }

  /**
   * 
   * 
   * 
   * Receive notification of the end of an element.
   * 
   * <p>
   * The SAX parser will invoke this method at the end of every element in the
   * XML document; there will be a corresponding startElement() event for every
   * endElement() event (even when the element is empty).
   * </p>
   * 
   * <p>
   * If the element name has a namespace prefix, the prefix will still be
   * attached to the name.
   * </p>
   * 
   * 
   * @param ns
   *          the namespace of the element
   * @param localName
   *          The local part of the qualified name of the element
   * @param name
   *          The element name
   */
  public void endElement(String ns, String localName, String name)
      throws org.xml.sax.SAXException {
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



