Chilkat HOME .NET Core C# Android™ AutoIt C C# C++ Chilkat2-Python CkPython Classic ASP DataFlex Delphi ActiveX Delphi DLL Go Java Lianja Mono C# Node.js Objective-C PHP ActiveX PHP Extension Perl PowerBuilder PowerShell PureBasic Ruby SQL Server Swift 2 Swift 3,4,5... Tcl Unicode C Unicode C++ VB.NET VBScript Visual Basic 6.0 Visual FoxPro Xojo Plugin
(Delphi DLL) Using CDATA in XMLDemonstrates how to force the content of a node to be encapsulated in CDATA. The output of the following program is an XML document that looks like this: <root> <year>2009</year> <junk1>abc .. < & > 123</junk1> <junk2><![CDATA[abc .. < & > 123]]></junk2> </root>
uses Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Xml; ... procedure TForm1.Button1Click(Sender: TObject); var xml: HCkXml; child1: HCkXml; child2: HCkXml; child3: HCkXml; begin xml := CkXml_Create(); CkXml_putTag(xml,'root'); child1 := CkXml_NewChild(xml,'year','2009'); child2 := CkXml_NewChild(xml,'junk1','abc .. < & > 123'); child3 := CkXml_NewChild(xml,'junk2','abc .. < & > 123'); CkXml_putCdata(child3,True); CkXml_Dispose(child1); CkXml_Dispose(child2); CkXml_Dispose(child3); Memo1.Lines.Add(CkXml__getXml(xml)); CkXml_Dispose(xml); end; |
© 2000-2024 Chilkat Software, Inc. All Rights Reserved.