XML library

XML library

  • uses standard Windows XmlLite API
  • supports Windows 32 and Windows 64
  • available for Delphi/C++Builder 7 - 12 and Lazarus 2.2.6
  • 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 $120 USD (license for one developer)
Order XML multi-license $360 USD (license for all developers in company)
Order XML year upgrades $60 USD (registered users only)
Order XML year upgrades multi-license $180 USD (registered multi-license users only)

Related links