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


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);
  xXml: XmlDoc.TXMLDocument;
  xXmlI: XmlIntf.IXMLDocument;
  xRoot: XmlIntf.IXMLNode;
  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;

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


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

Related posts

FireMonkey 10.4.2 Features Updated iOS 14, Android 11, And macOS 11 Support Plus Hundreds Of Fixes


Ryzen 9 5950x: One Billion Lines Of Delphi Code Compiled In ~5 Minutes On 16 Cores


DelphiCon 2020 FireMonkey Sessions Available Starting November 19


Powerful Commercial Gorilla3D Framework Upgraded For Delphi FireMonkey On Windows And Android

Sign up for our Newsletter and
stay informed

1 Comment

Leave a Reply