Tutorial is great and everything seems to be working perfectly, but i have one problem... in handler file when i write @Override near the public void startElement(String namespaceURI, String localName, String qName, Attributes atts) throws SAXException{} i get an error: public void startElement(String namespaceURI, String localName, String qName, Attributes atts) throws SAXException. And the only solution which eclipse suggest is to remove @Override, but then this method doesn't work. here is my code:
Using java Syntax Highlighting
/** Gets be called on opening tags like:
* <tag>
* Can provide attribute(s), when xml was like:
* <tag attribute="attributeValue">*/
@Override
public void startElement(String namespaceURI, String localName, String qName, Attributes atts) throws SAXException {
if(localName.equals("cases")){
this.in_cases = true;
}else if(localName.equals("case")){
this.in_case = true;
}else if(localName.equals("files")){
this.in_files = true;
}else if(localName.equals("file")){
this.in_file = true;
}else if(localName.equals("name")){
this.in_name = true;
}else if(localName.equals("title")){
this.in_title = true;
}else if(localName.equals("id")){
this.in_id = true;
}
}
Parsed in 0.035 seconds, using
GeSHi 1.0.8.4
Maybe somedy has any idea where the problem is? everything is ok with other functions.
[hr]
Edit: I found my mistake. It was wrong Attributes import. I had to import org.xml.sax.Attributes