Barre horizontale de naviagtion

lundi 21 mars 2011

Encode text data for XML



'''
''' this function used to encode the unicode and special caratere content in string data
'''

'''
'''
'''
Public Shared Function EncodeForXml(ByVal data As String) As String
Dim doc As New XmlDocument()
Dim node As XmlNode = doc.AppendChild(doc.CreateElement("xml"))
node.InnerText = data
Dim writer As New StringWriter()
Dim xml_writer As New XmlTextWriter(writer)
node.WriteContentTo(xml_writer)
Return writer.ToString()
End Function

Aucun commentaire:

Enregistrer un commentaire