So here is a short list:
" replace with " or 
& replace with & or 
' replace with ' or 
< replace with < or C;
> replace with > or E;
See more at http://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references
Example
<dummy comment="my 'special' char " >
You then convert it to
<dummy comment="my 'special' char " >
Here is a code example converting:
Private Function encodeXMLEntry(ByVal inData As String) As String
Dim x As String = inData
' Replace special characters, start with & for obvious reasons.
x = x.Replace("&", "&")
x = x.Replace("""", """)
x = x.Replace("'", "'")
x = x.Replace("<", "<")
x = x.Replace(">", ">")
' return the escaped string
Return x
End Function
No comments:
Post a Comment