.Net Runtime Library for Delphi
CNClrLib.Xml Namespace

The CNClrLib.Xml namespace contains interfaces that provides standards-based support for processing XML. These interfaces are defined as classes and interfaces in C# System.Xml Namespaces.Example

The following example compares two element names using the interfaces defined in CNClrLib.Xml namespace.

program XmlExample; {$APPTYPE CONSOLE} {$R *.res} uses CNClrLib.Xml, CNClrLib.Core; var nt: _NameTable; book, price: Variant; settings: _XmlReaderSettings; reader: _XmlReader; readerHelper: _XmlReaderHelper; objectHelper: _ObjectHelper; begin nt := CoNameTable.CreateInstance; book := nt.Add('book'); price := nt.Add('price'); // Create the reader. settings := CoXmlReaderSettings.CreateInstance; settings.NameTable := nt.AsXmlNameTable; readerHelper := CoXmlReaderHelper.CreateInstance; reader := readerHelper.Create_1('books.xml', settings); reader.MoveToContent; reader.ReadToDescendant('book'); objectHelper := CoObjectHelper.CreateInstance; if objectHelper.ReferenceEquals(book, reader.Name) then begin // Do additional processing. end; end.