Altova Mailing List Archives>Archive Index >microsoft.public.xml Archive Home >Recent entries >Thread Prev - CDATA tag missing even if specified >Thread Next - Re: CDATA tag missing even if specified Re: CDATA tag missing even if specifiedTo: NULL Date: 5/13/2009 3:14:00 PM rodv wrote:
> Hello group, i have to pieces of VB6 code, that add a CDATA section to an
> element
>
> Here are the excerpt of the relevant code
>
> Dim goXMLOutPutRegUninstallDoc As New MSXML2.DOMDocument
> Dim OutputString As String
> Dim OutputBody As IXMLDOMCDATASection
>
> Set goXMLOutPutRegUninstallOutput =
> goXMLOutPutRegUninstallDoc.createElement("RegUninstalloutput")
>
> Set OutputBody =
> goXMLOutPutRegUninstallDoc.createCDATASection("___TEST")
> goXMLOutPutRegUninstallOutput.appendChild OutputBody
>
>
> The problem is the CDATA tag is not added ! i really dont know why ?
> maybe someone could shed some light on this.
Consider to post a minimal but complete sample that allows us to
reproduce the problem. At least explain how you check that the CDATA
section has been added.
I have no problems with the following code:
Set doc = CreateObject("Msxml2.DOMDocument.3.0")
Set el = doc.createElement("foo")
el.appendChild doc.createCDATASection("a < b && b < c")
WScript.Echo el.xml
It outputs
<foo><![CDATA[a < b && b < c]]></foo>
--
Martin Honnen --- MVP XML
http://msmvps.com/blogs/martin_honnen/
| ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
