Details
-
Bug
-
Resolution: Won't Do
-
P3: Somewhat important
-
None
-
5.6.2
-
None
-
Windows, Linux and macOS
Description
Let's say that we have the following XML code where the xlink namespace is listed before the xlink:href attribute:
<main> <sub xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="href_value" /> </main>
Now, say that I want to retrieve the value of xlink:href. For this, I would use QDomNamedNodeMap::namedItemNS() and, as expected, it returns href_value.
On the other hand, if I was to use QDomNamedNodeMap::namedItem(), I would expect the value to be empty, yet I am also getting href_value...
Now, let's say that we have the following XML code where the xlink namespace is listed after the xlink:href attribute:
<main> <sub xlink:href="href_value" xmlns:xlink="http://www.w3.org/1999/xlink" /> </main>
Using QDomNamedNodeMap::namedItemNS(), I would expect to get href_value, but instead I am getting an empty string...
When it comes QDomNamedNodeMap::namedItem(), I would still expect an empty string, but once again I am getting href_value...
Here is the output of the attached program:
Namespace defined BEFORE the attribute: --------------------------------------- Retrieve the attribute value using QDomNamedNodeMap::namedItemNS(): - Expected value: [href_value] - Actual value: [href_value] Retrieve the attribute value using QDomNamedNodeMap::namedItem(): - Expected value: [] - Actual value: [href_value] Namespace defined AFTER the attribute: -------------------------------------- Retrieve the attribute value using QDomNamedNodeMap::namedItemNS(): - Expected value: [href_value] - Actual value: [] Retrieve the attribute value using QDomNamedNodeMap::namedItem(): - Expected value: [] - Actual value: [my_href_value]