The problem again is that although I have successfully implemented the SAX parser in my code ... It behaves strangely. This jus skips enteries after and goes to the next entry. I just wanted to know if this is a typical work of the SAX or m analyzer, which implements it incorrectly.
I implemented org.xml.sax.ContentHandler and provided the following encoding inside ...
`
public void characters(char[] ch, int start, int length)
{
if(lastName.equals("id"))
{
String id = String.copyValueOf(ch, start, length);
CustomList.idvector.add(id);
}
else if(lastName.equals("subcategory"))
{
String subcategory = String.copyValueOf(ch, start, length);
CustomList.subcategoryvector.add(subcategory);
}
else if(lastName.equals("photo"))
{
String photo = String.copyValueOf(ch, start, length);
CustomList.photovector.add(photo);
}
else if(lastName.equals("name"))
{
String name = String.copyValueOf(ch, start, length);
CustomList.namevector.add(name);
}
}
`
There are elements with tags ,,, and m that take this information into a vector ... is this correct ???
Now again the problem is that I cannot play a special character like "$" and such ... is there a way we can catch these characters?
source
share