Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
For an XML document to be valid it needs a Document Type Declaration (DTD).
In it's simplest form this looks like;
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE root>
<root>
something here
</root>
QlikView 11 and 11.2 was fine reading such an XML document.
As of QlikView 12 and also in Qlik Sense this generates an error on the second row (the DTD)!
Reply from R&D through support is that it is working as expected!?!
Their solution is to remove the DTD before reading the file in QlikView.
<?xml version="1.0" encoding="UTF-8"?>
<root>
something here
</root>
But then it is no longer a valid XML document!
According to W3C an XML document must have a Document Type Declaration to be valid.
Without the DTD it might be well formed (readable with matching tags) but can never be valid.
Many XML-documents in circulation are missing the DTD and thus are well formed but not valid.
Conclusion, Qlik no longer supports valid XML!
R&D claims it to be for security reasons.
Has to be when using external DTD-file reference
but then it could read the XML document and ignore the DTD.
Claiming XML support but refusing to read any valid XML document is a contradiction.
Hi Rickard
Maybee this could help? Qlik Support
Best regards
Peter
Description |
In Qlik View and Qlik Sense it appears that you cannot load XML files with Document Type Definition (DTD) content by default To verify if your XML file contain DTD information, you can simply open it (or save it on your disk if it's from a URL) and check usually the line 2. You should see something looking like: <!DOCTYPE random PUBLIC "-//NLM//DTD random "https://xxx/yyyzzz/file.dtd"> |
Cause |
The purpose of a Document Type Definition (DTD) is to define the legal building blocks of an XML document. It defines the document structure with a list of legal elements. This behavior is working as designed as by default we dont load xml files with a DTD because they can be used in denial of Service attacks. This security feature was not available in the previous version of QlikView for instance (11.20) |
Resolution |
If you want to load XML file with DTD content you will need to disable the setting ProhibitDTD.For Qlik Sense
You can then store the result in another XML file and load it normally in Qlik. The script would look like this (Note: For Qlik Sense you will need to use library instead of the path directly) Clean_XML: // Load content of the XML as Fixed Record file format and skip the first two lines LOAD [@1:n] FROM [Path_or_URL_to_the_XML] (fix, codepage is 1252, embedded labels, header is 2 lines); //Store the result in another XML STORE Clean_XML INTO "C:\temp\temp_xml.xml" (txt); DROP TABLE Clean_XML; // Start of [temp_xml.xml] LOAD statements Id: LOAD Field1, Field2 FROM |
Disclaimer |
Access to this article is provided to you as part of your subscription to Qlik Maintenance. This article is deemed to be “Documentation” under the terms of the license agreement applicable to your Qlik software. All rights reserved © QlikTech International AB. |