Decoding for XML

This section describes how to decode an XML NotificationContentList.

A NotificationContentList can include multiple values. If a NotificationContentList includes multiple values, each value must be concatenated into one string when decoding. For example, after concatenating the following values, the string is abcdef:
<NotificationContentList>
  <value>abc</value>
  <value>def</value>
</NotificationContentList>
The following code shows an example NotificationContentList:
<NotificationContentList>
 <value>H4sIAAAAAAAAAEVOSQ7CMAz8SpRzi5ImbZO+gw+YLFDRjTo5IMTfcReJ28x4Fn84JkgZeccFL7ib\0d\
0afSBYaSE2OgZEuG8KEXApw/CXlowP5iEBY2lmrxxyYMs6OzIEzzC7DcU8DG8KryEe3RMJBU8rTNh7\0d\
0aaql1E4WS2rY2asLggraNttoa42+qpmzqx/0pIU0p2lJWV9l0ynZSXURbH+WnR5z2BM8wETda7Xdc\0d\
0a5gnP9e8PQPK8vfQAAAA=\0d\0a</value>
</NotificationContentList>
To decode the NotificationContentList, you must complete the following:
  1. Concatenate the content of the values into one string.
  2. Replace string \0d\0a with a new line.
  3. Do a Base64 decode.
  4. Do a Gzip decode.
For example, to view the compressed field values in the list, save the values to a file (in this case, values.txt) and use the following command to decompress the values, decode the values, and do a global line ending replacement:
cat value.txt | sed -e 's/\\0d\\0a/\n/g' | base64 --decode |
				  gzip -d
After decoding the NotificationContentList shown above with this command, the following content is saved to value.txt:
{"status":"0","code":"24000","message":"","actualmessage":"push data to queue processed 
successfully","refcode":null,"transid":"546f0314979f446face496494988db35","time":
"2018-07-12T16:39:13.075","reftime":"0","timetaken":"843","response":null}