Print Page | Close Window

How to create XML using CDATASection

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=24386
Printed Date: 22 December 2024 at 8:28am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: How to create XML using CDATASection
Posted By: bunei
Subject: How to create XML using CDATASection
Date Posted: 20 April 2023 at 9:47pm
Hi All,

I'm using CXTPPropExchangeXMLNode to create XML.
I want to add a CDATA section to that XML.

CMyPropExchangeXMLNode px(FALSE, 0, "data");

struct XTPXML::IXMLDOMCDATASection* _result = 0;
_variant_t value = "<params>CDATA Section</params>";

CXTPDOMDocumentPtr xmlDocumentPtr = px.GetDocument();
HRESULT hr = xmlDocumentPtr->createCDATASection((_bstr_t)value, &_result);

CXTPDOMNodePtr xmlEntryPtr = px.GetEntryNode("www", TRUE);
XTPXML::IXMLDOMNode *pChildOut = NULL;
hr = xmlEntryPtr->appendChild((XTPXML::IXMLDOMNode*)_result, &pChildOut);
(hr = 0x80004005)
px.SaveToFile("test.xml");

How to create XML using CDATASection please.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net