Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
encoding/xml: allow Marshal to use CDATA #12963
My team is interested in generating VAST 3 (video ad standard template) XML using the xml package. Unfortunately the VAST 3 spec specifies:
" All URIs or any other free text fields containing potentially dangerous characters contained in the VAST document should be wrapped in CDATA blocks." http://www.iab.net/media/file/VASTv3.0.pdf p. 23
Currently fields labeled with the xml ",chardata" tag are only output as URL encoded XML. We have a workaround using the Marshaler interface, but it's verbose and bug prone. i.e:
There should be a first-class way to output CDATA escaped data in the xml package, perhaps with the addition of a ",cdata" tag.