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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Choice a ContentHandler in SaxParser with Java

Status
Not open for further replies.

rorqual

Programmer
Jan 12, 2001
12
0
0
FR
Hi,
I wants to know how specify a ContentHandler in my SaxParser
the source's begining is :
SaxParser (String p_szUri,String p_szContentHandler) {
try {
XMLReader parser = XMLReaderFactory.createXMLReader("org.apache.xerces.parsers.SAXParser");
l_szResult = ""; //my result to print in a TextArea
parser.setContentHandler(this);
parser.parse(p_szUri);
}
...

Instead of this (my parser fonctions are at the bottom of this file) in parser.setContentHandler(this); I needs to specify another file.
The solution is an interface which works, but it's a little complex and I thinks there's a fonction to cast the path of a handler for the .setContentHandler()
Excuse me for my poor english, but can you indicate if the interface is the only solution or not.
Thx

Sebastien
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top