I want to store a string which itself is an XML string as a property of an JSON object , what's the reliable and proper way of dong this? Should I first encode the XML data into BASE64 first prior saving it to an JSON object, due to the fact that JSON does not support binary data?
Example of data I want to store:
{
"string1" : "<xml>...moderately complex XML...</xml>"
}
Actually base 64 should work. But you might want to mark the property so it is clear.
{
"Property" : {
"Type" : "XML",
"Encoding" : "Base64",
"Value" : "PFhNTD48WE1MPjxYTUw+PC9YTUw+PC9YTUw+PC9YTUw+"
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With