Package org.htmlparser.util

Examples of org.htmlparser.util.NodeList.elementAt()


      nodes = parser.extractAllNodesThatMatch(nfilter);
    } catch (ParserException e) {
      return html;
    }
    for(int i=0;i<nodes.size();i++){
      TextNode node = (TextNode)nodes.elementAt(i);
      text.append(node.getText());
    }
    return StringUtils.remove(text.toString(),"&nbsp;");
  }
View Full Code Here


            //System.out.println("Parent node is no ended. "+parent.getText());
            prvContent.append(((TagNode)parent).getEndTag().toHtml());
          }while(true);
          break;
        }
        node = nodes.elementAt(i);
        if(node instanceof TagNode){
          TagNode tag = (TagNode)node;
          prvContent.append('<');
          prvContent.append(tag.getText());
          prvContent.append('>');
View Full Code Here

    parser.setInputHTML(new String(inputHtml.getBytes(),ISO8859_1));
    //Parser parser = Parser.createParser(new String(inputHtml.getBytes(),ISO8859_1));
    //�������еĽڵ�
    NodeList nodes = parser.extractAllNodesThatMatch(nodeFilter);
    for(int i=0;i<nodes.size();i++){
      Node node = nodes.elementAt(i);
      text.append(new String(node.toPlainTextString().getBytes(ISO8859_1)));
    }
    return text.toString();
  }
View Full Code Here

      parser.setEncoding("8859_1");
      parser.setInputHTML(html);
      //�������еĽڵ�
      NodeList nodes = parser.extractAllNodesThatMatch(scriptFilter);     
      for(int i=0;i<nodes.size();i++){
        Node node = nodes.elementAt(i);
        if(node instanceof TextNode)
          text.append(node.getText());
        else{
          text.append('<');
          text.append(node.getText());
View Full Code Here

      if (DebugFile.trace) DebugFile.writeln("NodeList.size() = " + String.valueOf(nImgs));

      for (int i=0; i<nImgs; i++) {

        sSrc = ((ImageTag) oCollectionList.elementAt(i)).extractImageLocn();

        // Keep a reference to every related image name so that the same image is not included twice in the message
        if (!oDocumentImages.containsKey(sSrc)) {

          // Find last slash from image url
View Full Code Here

    int nImgs = oCollectionList.size();

    if (DebugFile.trace) DebugFile.writeln("Images NodeList.size() = " + String.valueOf(nImgs));

    for (int i=0; i<nImgs; i++) {
    ImageTag oImgTag = (ImageTag) oCollectionList.elementAt(i);
     
        sSrc = oImgTag.extractImageLocn().replace('\\','/');
   
    if (DebugFile.trace) DebugFile.writeln("Processing image location "+sSrc);
   
View Full Code Here

    if (DebugFile.trace) DebugFile.writeln("Tables NodeList.size() = " + String.valueOf(nImgs));

    for (int i=0; i<nImgs; i++) {

      sSrc = ((TableTag) oCollectionList.elementAt(i)).getAttribute("background");
      if (sSrc!=null) {
        if (sSrc.length()>0) {
          sSrc = sSrc.replace('\\','/');

      if (DebugFile.trace) DebugFile.writeln("Processing background location "+sSrc);
View Full Code Here

            if (DebugFile.trace) DebugFile.writeln("HashMap.put("+sSrc+","+sCid+")");

            oImgs.put(sSrc, sCid);
          } // fi (!oImgs.containsKey(sSrc))
     
      sBodyCid = doSubstitution (sBodyCid, "Background", Gadgets.replace(Gadgets.replace(((TableTag) oCollectionList.elementAt(i)).getAttribute("background"),'\\',"\\\\"),'.',"\\x2E"), sPreffix+oImgs.get(sSrc));

        } // fi
      } // fi
    } // next
View Full Code Here

    if (DebugFile.trace) DebugFile.writeln("TD NodeList.size() = " + String.valueOf(nImgs));

    for (int i=0; i<nImgs; i++) {

      sSrc = ((TableColumn) oCollectionList.elementAt(i)).getAttribute("background");
      if (sSrc!=null) {
        if (sSrc.length()>0) {
          sSrc = sSrc.replace('\\','/');

      if (DebugFile.trace) DebugFile.writeln("Processing td bg location "+sSrc);
View Full Code Here

            if (DebugFile.trace) DebugFile.writeln("HashMap.put("+sSrc+","+sCid+")");

            oImgs.put(sSrc, sCid);
          } // fi (!oImgs.containsKey(sSrc))
     
      sBodyCid = doSubstitution(sBodyCid, "Background", Gadgets.replace(Gadgets.replace(((TableColumn) oCollectionList.elementAt(i)).getAttribute("background"),'\\',"\\\\"),'.',"\\x2E"), sPreffix+oImgs.get(sSrc));
        } // fi
      } // fi
    } // next

    if (DebugFile.trace) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.