1 Reply Latest reply: Sep 15, 2008 7:41 AM by thomas.behr RSS

    parser

    843810
      hai all,
      I want to extract all the starting tags it's attributes and values ,links from a HTML page. now i can extract only starting tag using the code below

      public void parse(File HTMLFile) throws IOException {
      DTD dtd = DTD.getDTD("jsp.dtd");
      Parser parser = new Parser(dtd ) {
      @Override
      protected void startTag(TagElement element) throws ChangedCharSetException{
      System.out.println("Start tag: " + element.getElement().getName());
      }
      };
      try {
      parser.parse(new FileReader(HTMLFile));
      }
      catch (Exception e) {
      // Catch exception if any
      System.err.println("Error: " + e.getMessage());
      }
      }
      }
        • 1. Re: parser
          thomas.behr
          Sorry, but this is the wrong forum for this kind of question. Besides, cross-posting (see http://forums.sun.com/thread.jspa?threadID=5331457&messageID=10424020#10424020) is considered rude hereabouts.