[Development] Qt XML and Qt Xml Patterns

Thiago Macieira thiago.macieira at intel.com
Tue May 21 06:31:58 CEST 2019


On Monday, 20 May 2019 19:35:03 PDT Kevin Kofler wrote:
> Thiago Macieira wrote:
> > The replacement for QtXml are the streaming classes in QtCore. They've
> > been available for 10 years.
> 
> But those are no replacement for the QDom* DOM API. They are also not
> idiomatic SAX, by design. Both those limitations make them an insufficient
> replacement for QtXml even for new code, let alone all the existing legacy
> code.

The replacement is not a 1:1 API style and was never meant to. The stream XML 
are StAX, whereas QDomDocument is DOM and QXmlReader is SAX. The point is that 
you can still read and write XML, it's fast and supports namespaces properly.

> Looking around (e.g., in KDE projects and/or related third-party Free
> Software projects), you will find QtXml still widely used, probably even
> more widely than the newer QtCore XML streaming API (depending on your
> sample).

I know. The DOM is extremely useful, which is why I wrote QCborValue (DOM) in 
addition to QCborStream{Reader,Writer} (StAX) and that's why QJsonDocument 
(DOM) is so easy to use.

But the fact is that QDomElement and friends aren't getting maintained.
-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel System Software Products





More information about the Development mailing list