I serialize array of strings to XML, my output:
<MyArray>
<anyType xsi:type="xsd:string">testString</anyType>
<anyType xsi:type="xsd:string"></anyType> // here is empty string, and I want it in output array
</MyArray>
When I try to deserialize this back to array with XMLPullParser it’s create array only with one string.
Why function next() from XmlPullParser on second string only return START_TAG and END_TAG, without TEXT event?
There is any workaround to get empty string from this xml?
According to http://developer.android.com/reference/org/xmlpull/v1/XmlPullParser.html,
more specifically the nextText() method documentation, you get:
The sample code they provide works well, and I’m currently using in my code something in the lines of:
Which works just fine, regardless it’s an empty string or not. Are you using the
org.xmlpull.v1.XmlPullParserlibrary?