Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    XMLTools problem with Chrome 45

    Hello,

    Since the last version of Chrome (45), it seems it's not possible to get the value of an attribute in a XML document with a XPath query.

    Here is a simple example to reproduce :

    Code:
    var xmlDoc = XMLTools.parseXML('<?xml version="1.0" encoding="UTF-8" standalone="yes"?>' +
    									'<values id="c730cd18">' +
    									'	<value key="1" label="SOC I">TADA</value>' +
    									'	<value key="2" label="SOC II">TODO</value>' +
    									'</values>');
    							
    var xpathResult1 = XMLTools.selectString(xmlDoc, '/values/value[1]/@label');
    console.log("xpathResult1:", xpathResult1);
    With all browsers except Chrome 45, the result will be : "xpathResult1: SOC I"

    With Chrome 45 the result is : "xpathResult1: "

    Tested and detected with SmartClient 8.3, the problem is the same with the last version of SmartClient.

    It seems there is the same report on SmartGWT in this entry : http://forums.smartclient.com/showthread.php?t=33436

    Is it a bug in SmartClient or in Chrome ?

    #2
    A solution

    I found a solution. The problem is in XMLTools.getElementText : there is already a message in the source code about a change in Firefox 13/14 and it seems it's the same problem since Chrome 45 :

    Code:
    from Firefox 13 to Firefox 14 XML nodes representing attributes were changed
    to no longer have a #text child.
    So I added a test on "isc.Browser.isChrome" when there is no child and "nodeType" is 2. In my case with this change all is running fine.

    I hope it can help.

    Comment


      #3
      Noticed the same problem. Will this be fixed upstream?

      Comment


        #4
        Thanks for the solution.

        This solution has been applied on 10.1d, 10.0p, 9.1p, 9.0p and 8.3p branches. You will see this solution in nightly builds as of tomorrow, (September 9).


        Regards
        Isomorphic Software

        Comment

        Working...
        X