QDomDocument::setContent() and error parsing
-
@Christian-Ehrlicher Thank you.
I suppose I misunderstood the documentation here?
https://doc.qt.io/qt-5/qtxml-module.html#detailsBut I am glad to know that it is still officially supported. I will take a look at Qt XML Patterns now.
-
@Robert-Hairgrove Do you mean "Note that the module will not receive additional features anymore"? This does not mean it is depricated.
-
@Christian-Ehrlicher Now that Qt 6.0 has been released, I see that the XML patterns module was removed entirely from this version of Qt. What do I need to do, building with Qt 6, in order to validate an XML document against a schema XSD document stored in Qt resources, for example? I haven't found any relative documentation which explains how to compensate for the removal of XML patterns.
Resetting this thread to "unsolved".
-
@Robert-Hairgrove Don'T use Qt6 or an external xsd validation library. You will not get it back in Qt6 except you write it on your own.
-
@Christian-Ehrlicher Thank you.
I assume you meant to write: "Don't use Qt6, or
else use
an external xsd validation library"?I know that I could do this with Xerces, but would like to avoid the dependency if I can. Does anyone have suggestions for a lightweight external library? It should work on Linux and Windows, if possible.
-
@Robert-Hairgrove
I feel your pain. We won't be thanked/will be shot down for saying this, but if you are saying theQXml...
classes are gone from Qt 6(?) that is a sad, retrograde step for those of us who use XML. In that case I just hope they drop the JSON support too.... -
@JonB The removed features are listed here. There are still classes which are named beginning with
QXml...
, but I don't know if they still work as they did before: -
I bit the bullet and now am using Xerces. It's fairly easy to use, but quite a large library to install. At least it works on both Windows and Linux, and the licensing is agreeable.
-
Hi,
I am confrontied to the same issue. I have a Qt5 application relying on QXmlSchemaValidator validator; to validate an xml against an xsd file. Not sure what shall be done to port my application to Qt6? Does the QXmlStreamReader do this check implicitely?
Regards,
Billl -
QXmlStreamReader is for reading xml, not for validating. You have to use another 3rd party library.