Details
-
Bug
-
Resolution: Unresolved
-
P1: Critical
-
None
-
5.12.0, 5.12.1, 5.12.2, 5.12.3
-
None
Description
Scenario: reading an xml file with QXmlStreamReader and writing every (unmodified) token to another file with QXmlStreamWriter.
QString streamXML(QString const& xmlIn) { QString xmlOut; QXmlStreamReader reader(xmlIn); QXmlStreamWriter writer(&xmlOut); while (!reader.atEnd()) { reader.readNext(); writer.writeCurrentToken(reader); } return xmlOut; } streamXML(QString("<?xml version='1.0'?><abc:elem1 xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:abc='ns1' />"));
The output is:
<?xml version="1.0"?><n1:elem1 xmlns:n1="ns1" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:abc="ns1"/>
Please note, that the namespace is renamed and doubled.
Instead of:
<?xml version="1.0"?><abc:elem1 xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:abc="ns1"/>
This issue was caused by the changes for https://bugreports.qt.io/browse/QTBUG-63434
I already patched my local qt sources with a fix, but I'm not aware of the check in process, therefore i have appended my patchfile.
Please review my patch and check it in. The issue will occur with most XML files using namespaces that's why i think it has important priority.