Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How can I create CDATA node with TXMLDocument

771 views
Skip to first unread message

Alejandro Castro

unread,
May 15, 2007, 9:39:39 PM5/15/07
to
Im trying to create a CDATA section on a XML document, the most I have found
is something like

XML1: TXMLDocument
.
.

XML1.CreateNode('SCRIPT',ntCData)

But obviously, doesnt work.

What is the way to to it ?

Thanks
Alejandro


Eddie Shipman

unread,
May 16, 2007, 9:40:17 AM5/16/07
to
Alejandro Castro wrote:

Using straight MSXML:

var
n: IXMLDOMCDATASection;
begin
n := oXMLDoc.createCDATASection('nothing here');
oXMLDoc.childNodes.item[1].appendChild(n);
end;

--

Remy Lebeau (TeamB)

unread,
May 16, 2007, 1:49:55 PM5/16/07
to

"Eddie Shipman" <mr_delphi...@nospamyahoo.com> wrote in message
news:xn0f69o95...@forums.borland.com...

> n := oXMLDoc.createCDATASection('nothing here');

T/IXMLDocument.CreateNode() calls IDOMDocument.createCDATASection()
when ntCData is specified.


Gambit


Remy Lebeau (TeamB)

unread,
May 16, 2007, 1:50:23 PM5/16/07
to

"Alejandro Castro" <alej...@poware.com> wrote in message
news:464a60e0$1...@newsgroups.borland.com...

> XML1.CreateNode('SCRIPT',ntCData)
>
> But obviously, doesnt work.

Just saying that something doesn't work says nothing about the actual
problem you are having with it. You need to be more specific. Please
show a more complete code snippet that demonstrates what you are
trying to do and why you think it is not working.


Gambit


Max-Max

unread,
Sep 26, 2007, 1:27:09 PM9/26/07
to

> Im trying to create a CDATA section on a XML document, the most I have found
> is something like
>
> XML1: TXMLDocument
> ..
> ..

>
> XML1.CreateNode('SCRIPT',ntCData)
>
> But obviously, doesnt work.
>
> What is the way to to it ?
>
> Thanks
> Alejandro
>

It it obvious why it is not working!

MyNode = CreateNode(a,b);

..only creates and returns the node. The node is NOT linked into the XML document.

You need to add the node manually into the XML Tree.

ChildNodes->Add(MyNode);

// Max

BizTalk Utilities - Frustration free BizTalk Adapters
http://www.topxml.com/biztalkutilities

0 new messages