Provide serialization and de-serialization of different formats based on Google’s protobuf Message. Enables overriding the default (byte array) output to text based formats such as XML, JSON and HTML.
BSD 3-Clause "New" or "Revised" License
153
stars
97
forks
source link
com.googlecode.protobuf.format.XmlFormat merge fails for content with URL #43
When the XML content contains special characters like URL the formatter fails to merge.
Is there a work around for this ?
XmlFormat xmlBinder = new XmlFormat();
xmlBinder.setDefaultCharset(StandardCharsets.UTF_8);
InputStream data = new ByteArrayInputStream(xmlView.getBytes("UTF-8"));
xmlBinder.merge(data, extensionRegistry, builder);
When the XML content contains special characters like URL the formatter fails to merge. Is there a work around for this ?
XmlFormat xmlBinder = new XmlFormat();
xmlBinder.setDefaultCharset(StandardCharsets.UTF_8); InputStream data = new ByteArrayInputStream(xmlView.getBytes("UTF-8")); xmlBinder.merge(data, extensionRegistry, builder);
Input XML: