I'm parsing an xml file with saxParser on java. My problem is that I have some rows like this:
<name xml:lang="en">Particulates, < 2.5 um</name>
I don't report all the code but if the tag == name I set the name on my object.
@Override
public void characters(char[] ch, int start, int length) throws SAXException {
if (isElementaryExchange && isName ) {
String name = new String(ch, start, length);
this.currentElementaryFlowBase.setName(name);
}
The problem is that the result is name=" 2.5 um" because I think that the "<" broke something. There's a way to parse correctly that row? Thanks
EDIT Solved with a Stringbuilder: Append on characters method and set the result only at the end of the element!