XML library

XML library

  • uses standard Windows XmlLite API
  • supports Windows 32 and Windows 64
  • available for Delphi/C++ Builder 7 - 10.4 and Lazarus 2.0.8
  • source code included in registered version
  • royalty free distribution in applications

Examples

// create XML document
with TXmlWriter.Create('document.xml') do
try
  Indent := True;
  StartDocument;
    StartElement('element1');

      Comment('comment');

      StartElement('element2');
        Attribute('attribute1', 'value1');
        Attribute('attribute2', 'value2');
        Text('Hello, world!');
      EndElement;

      StartElement('element3');
        CData('data');
      EndElement;

    EndElement;
  EndDocument;
finally
  Free;
end;

// parse XML document
var
  Text: string;
  I: Integer;

with TXmlReader.Create('document.xml') do
try
  while Read do
  begin
    Text := IntToStr(Line) + ',' + IntToStr(Position) + ': ' + NodeToString(Node);
    case Node of
      xnElement:
      begin
        Text := Text + ': ' + Name;
        Element;
        FirstAttribute;
        for I := 1 to AttributeCount do
        begin
          Text := Text + ' ' + Name + '=' + Value;
          NextAttribute;
        end;
      end;

      xnText: Text := Text + ': ' + Value;
      xnCData: Text := Text + ': ' + Value;
      xnComment: Text := Text + ': ' + Value;
      xnWhitespace: Text := Text + ': "' + Value + '"';
      xnEndElement: Text := Text + ': ' + Name;
      xnXmlDeclaration: Text := Text + ': ' + Name;
    end;
    ShowMessage(Text);
  end
finally
  Free;
end;
								

Download and order

Order XML library $80,- USD (license for one developer)
Order XML multilicense $240,- USD (license for all developers in company)
Order XML year upgrades $40,- USD (registered users only)
Order XML year upgrades multilicense $120,- USD (registered multilicense users only)

Related links