SanitizeXmlElementText Method
Definition
- Namespace
- Cuemon.Extensions.Xml
- Assemblies
- Cuemon.Extensions.Xml.dll
SanitizeXmlElementText(string, bool)
Sanitizes the value for any invalid characters.
public static string SanitizeXmlElementText(this string value, bool cdataSection = false)
Parameters
valuestringThe string to extend.
cdataSectionboolif set to
truesupplemental CDATA-section rules is applied tovalue.
Returns
Remarks
Sanitation rules are as follows:
1. The value cannot contain characters less or equal to a Unicode value of U+0019 (except U+0009, U+0010, U+0013)
2. The value cannot contain the string "]]<" if cdataSection is true.