Android : XmlSerializer or FastXmlSerializer writes & for &

122 views Asked by At

In android, when writing some values containing '&' in the text part, FastXmlSerializer.attribute() or Xml.newSerializer().attribute(), method encodes '&' as '&amp ;'. Is there any other Xml serializer or the property that must be set to write '&' as it is in xml data?

Thanks in advance.

1

There are 1 answers

0
Michael Kay On

& in XML must always be escaped as &, otherwise the XML will be invalid. Do you really want to write invalid XML?