I want to generate an XML document from data presented in a Notes view. The column formulas generate all of the XML tags necessary for the XML records and the $$ViewTemplate produces all of the correct XML tags to wrap up the document. Everything worked properly!
Until someone entered data into one of the text fields used in the view. The field was called Title and the offending value was “R&D Publications”. The ampersand in the title rendered the XML invalid.
What I really want is an @ formula called @HtmlEncode (and its partner @HtmlDecode) which would work in a way analogous to @UrlEncode and @UrlDecode. Occurrences of & would be translated to & and < would be translated to <. But, alas, such a function does not seem to exist.
In your view colum, add a formula to replace the ampersand character with “&” or as an alternative, wrap that field in CDATA, but try the replacement first. Look around on the forum and you’ll probably come up with some code to replace the ampersand and OTHER unsafe characters – there are a BUNCH of them!!!