Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

catching comments in SAX

Status
Not open for further replies.

kanghao

IS-IT--Management
Jul 4, 2004
68
KR
my handler looks like ---------------
public class RMSAXDefaultHandler extends DefaultHandler implements LexicalHandler {
...
...
public void comment(char[] ch, int start, int length) throws SAXException {
System.out.println("comment ===============");
String comment = new String(ch, start, length);
xml_value = xml_value + comment;
}
...
...
}
in my appllication --------------
RMSAXDefaultHandler handler = new RMSAXDefaultHandler(list);
SAXParserFactory factory = SAXParserFactory.newInstance();
factory.setValidating(validating);
factory.newSAXParser().parse(new File(filename), handler);

I can't seem to catch comment event.
what's wrong?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top