Get access to over 100 FireMonkey cross platform samples for Android, IOS, OSX, Windows, and Linux!

AndroidAppmethodComponentDelphiFiremonkeyIOSOSXWindows

Blazing Fast XML Component For Delphi XE5 Firemonkey On Android And IOS

Delphi XE5 Firemonkey XMLThere is a new XML parsing component called OXml now available in beta from Ondrej Pokorny which looks to be pretty good. Up on the website for the component there are some benchmarks and OXml looks a lot faster than the native TXMLDocument that ships with Delphi XE5 Firemonkey. OXml works across all platforms supported by XE5 which includes Android and IOS. OXml is also currently a free component set. One interesting feature I see that it has is the ability to read and write invalid XML and even correct errors in the documents. It is always a pain when you are attempting to read an XML document and your XML library does not want to work because the XML document is malformed somehow. You can even set up OXml to be the vendor for the native TXMLDocument that ships with Delphi XE5 Firemonkey. Here is some sample code which shows how that works:

uses XmlIntf, XmlDoc, OXmlDOMVendor;

procedure TestOXmlVendor(const aOutputMemo: TMemo);
var
  xXml: XmlDoc.TXMLDocument;
  xXmlI: XmlIntf.IXMLDocument;
  xRoot: XmlIntf.IXMLNode;
begin
  xXml := XmlDoc.TXMLDocument.Create(nil);
  xXml.DOMVendor := xmldom.GetDOMVendor(sOXmlDOMVendor);
  xXmlI := xXml;

  //now use xXmlI just like every other TXMLDocument
  xXmlI.Active := True;
  xRoot := xXmlI.Node.AddChild('root');
  xRoot.ChildNodes.Add(xXmlI.CreateNode('text', ntText));
  xRoot.ChildNodes.Add(xXmlI.CreateNode('node', ntElement));

  aOutputMemo.Lines.Text := xXmlI.Node.XML;
end;


Head over and download the OXml beta and try it out.

Have Delphi Firemonkey questions? Ask and get answers on StackOverflow.

Related posts
DelphiDemoFiremonkeyIOSLinuxOSXWindows

Bring OpenAI Agents, Vision, Audio, And Realtime AI To Firemonkey

DelphiIDEWindows

Add AI Pair Programming, Refactoring, And Multi-LLM Workflows To RAD Studio

DelphiDemoFiremonkeyLibraryWindows

Bring OpenAI, Local LLMs, And AI Assistants To FMX Apps

DelphiFiremonkeyLibrary

DelphiGemini Brings Native Google Gemini AI Integration To Delphi

Sign up for our Newsletter and
stay informed
[mailpoet_form id="1"]

1 Comment

Leave a Reply