protobuf-java-format
protobuf-java-format copied to clipboard
com.googlecode.protobuf.format.XmlFormat merge fails for content with URL
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: <Response> <TransactionReference> <CustomerContext>ltl.upsfreight.com/ProductsAndServices/terminals/index.aspx?qcountry=US&SvcCtrId=FON</CustomerContext> <XpciVersion>1.0</XpciVersion> </TransactionReference> <ResponseStatusCode>1</ResponseStatusCode> <ResponseStatusDescription>Success</ResponseStatusDescription> </Response>