Link to home
Start Free TrialLog in
Avatar of hiramlight
hiramlightFlag for United States of America

asked on

Inserting CDATA in xml node

I have an existing xml file and I want to be able to add data but with the <![CDATA[ somedata ]]> into the node wwhen I try i just get :   &lt;![CDATA[mystring]]&gt;.

try many things but so far fail

that what I use

                        If n1.Name = "name" Then

                            Dim MyXMLNode As XmlNode = n1.SelectSingleNode("ldm1")
                            'If we have the node let's change the text
                            If MyXMLNode IsNot Nothing Then
                                Dim strtxt As String = "<![CDATA[" & strtxtPlats & "]]>"
                                 ' CData = myXmlDocument.CreateCDataSection (strtxtPlats)
                                MyXMLNode.InnerText =strtxt

                               
                            End If

cheer's
ASKER CERTIFIED SOLUTION
Avatar of hiramlight
hiramlight
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial