Special characters in XML files created with QDomDocument
-
Here are the results of the checks with Microsoft's Office Excel:
- one has to rename the file from .xlsx to .xml to be able to import it
- using a literal newline character ('\n') in the strings does not work
- replacing the literal newline with ' ' (aka entity) does work
- one must put a suitable cell format into the xml to enable line breaks
So, the conclusion is, that the XML parser that is used by Excel to handle the file is definitely broken and does not follow the standards!
You can easily test this by using xmllint: Save a file from excel in XML format, have xmllint parse it and save the result (this replaces all ' ' with literal newlines) and try to open the file in Excel. It will fail.
Unfortunately I see no chance in getting some easy support for this case into Qt. You would have to patch method "static QString encodeText()" in qdom.cpp to escape newlines.