I'm using kXML2 on a legacy JavaME project. I'm receiving an XML where some attributes contain encoded entites. When I retrieve that attribute value with the call:
parser.getAttributeValue
It throws an Exception:
XmlPullParserException: unresolved
I have downloaded the last version of this parser, but it still shows this behavior.
If I remove the problematic line from XML, then there are no errors.
Ok, here is what is happening:
The parser must decode entities in attributes, unless you set this property:
But this implementation throws an exception when that line is called. Allright, so I debugged into the parser source code and I found out that this pull-parser implementation has trouble with entities that are not very common.
So I must inflate the parser entity replacement map with my own "odd" entities for it to work, like this:
And then everything works fine.