View member feedback to this tip.
XML strings must be encoded to conform to standards. Unfortunately, in Domino there are no XML encoding functions like @URLEncode.
The code below is a LotusScript version of this function. It encodes the five specific entities into their XML encoded ones. For all characters outside of the basic ACII, set it to encode these with the character code.
MEMBER FEEDBACK TO THIS TIP
While this tip is potentially useful, it is, in it's current form, unusable.
- "&" must be converted to "&"
- "<" must be converted to "&lt;"
- ">" can be converted to "&gt;" for strict XML compliance, although I have not found this to be necessary.
Jack S.
******************************************
I think the code below may be more efficient than that presented in this tip. You don't need to call any function or loop through text character by chara...
To continue reading for free, register below or login
To read more you must become a member of SearchDomino.com
');
// -->

cter, you just use the Replace function wherever you need to correct strings for XML. By the way, Replace is new with R6.
Adam H.
******************************************
This code should use the Uni() function instead of the Asc() function, because XML entities are encoded as Unicode values.
Rich S.
******************************************
Thanks for your comments on my tip.
Jack S.: I think you misread the code, because it already is in there
Adam H.: You're partially right. For large string this might be more efficient, but you will still need to loop the string character by character for the characters outside the basic ascii set
Rich S.: If the inputStr is Unicoded then you do need Uni()'; if you create the string in script you won't need it.
Ronald Pijpers, tip author
Do you have comments on this tip?Let us know.
This tip was submitted to the SearchDomino.com tip exchange by member Ronald Pijpers. Please let others know how useful it is via the rating scale below. Do you have a useful Notes/Domino tip or code to share? Submit it to our monthly tip contest and you could win a prize and a spot in our Hall of Fame.