Save XML node as CDATA rather then just a regular node
Posted on 2006-06-25
How can I save each node as CDATA rather then default text which gets processed by VB and removes all potentially invalid characters ?
The code I have now is below, where can I set the node being saved as CDATA ?
Dim I As Integer = 0
Dim FileLocation As String = StatusStrip1.Items(0).Text
Dim loXMLDoc As XmlDocument = New XmlDocument, loNode As XmlNode
For I = 0 To dgPublic.Rows.Count - 1
ID = dgPublic.Rows(I).Cells(0).Value.ToString
sValue = dgPublic.Rows(I).Cells(1).Value.ToString
loNode = loXMLDoc.SelectSingleNode("//Root/PS/KeyWord[@id=" & ID & "]")
loNode.InnerText = sValue
Catch ex As Exception
blDONE = False
strERROR = strERROR & "Node ID " & ID & " failed to update." & vbCrLf