countrymeister
asked on
XmlDocument Load xml
I have a stringbuilder object that I want to load into an Xmldocument.
I concat the nodes and elements within code. And I amhandling escape characters with CDATA in certain cases.
I need to know how to handle excape characters within a grouping.
I have an element called codes which could have one or more code's which has two attributes code and descriptionn. I need to handle if description has escape characters.
Should the concatanation of stringbuilder look something like this?
<code code="200" description="[CDATA[ORDER 100 & two]]"/>
I concat the nodes and elements within code. And I amhandling escape characters with CDATA in certain cases.
I need to know how to handle excape characters within a grouping.
I have an element called codes which could have one or more code's which has two attributes code and descriptionn. I need to handle if description has escape characters.
Should the concatanation of stringbuilder look something like this?
<code code="200" description="[CDATA[ORDER 100 & two]]"/>
<record>
<userid datatype='order'>151</webuserid>
<txtlastname datatype='order'><![CDATA[ANNIE]]></txtlastname>
<txtfirstname datatype='order'><![CDATA[SMITH]]></txtfirstname>
<txtaddress datatype='order'><![CDATA[79 TEST DR]]></txtaddress>
<txtcity datatype='order'><![CDATA[SOMEWHERE]]></txtcity>
<txtstate datatype='order'><![CDATA[NJ]]></txtstate>
<txtzip datatype='order'><![CDATA[08083]]></txtzip>
<codes datatype='order'>
<code code="100" description="ORDER 100"/>
<code code="200" description="ORDER 100 & two"/>
</codes>
</record>
Dim sb As New StringBuilder()
Dim XmlDoc As New System.Xml.XmlDocument
''''some logic to append values''''
sb.Append("'><![CDATA[")
'''''append value''''''
sb.Append("]]></")
XmlDoc.LoadXml(sb.ToString)
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.