There 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;
Exellent parser!!!