MindVisualizer--Mind Mapp Guest
|
Posted: Fri Jan 19, 2007 9:13 am Post subject: OpenXml(XDom), How to read/write TDomCDATASection? |
|
|
Dear all,
Dose anybody tried to operate on the TDomCDATASection class intruduced
in the open source xml lib, XDOM? Could you give me a example? Many thinaks!
This lib is good, but really leak of document and examples!
My code showed below caused access violation and the program terminated
unexpectedly.
writing a cdata node:
-----------------------------------
var
notesTxtCopy: TDomCDATASection;
begin
notesTxtCopy := TDomCDATASection.Create(aNode.OwnerDocument);//aNode
is a object of type TDomElement that works fine.
notesTxtCopy.Data := 'some text';
aNode.AppendChild(notesNode);
-----------------------------------
reading a cdata node:
-----------------------------------
var
notesTxtCopy: TDomCDATASection;
someText: WideString;
begin
notesTxtCopy := TDomCDATASection(aNode.FirstChild);
if notesTxtCopy <> nil then
someText := notesTxtCopy.Data;
-----------------------------------
--------------------------------------------------------------------------------
Edwin
Best Regards,
Mind Visualizer--Productive Mind Mapping Software
http://www.mindmapware.com/
2006-11-20 |
|