PDA

View Full Version : Ext.DomQuery.selectValue() doesn't work for CDATA node in FireFox2



ronnin
5 Jul 2007, 10:55 PM
Ext.DomQuery.selectValue() doesn't work for CDATA node in FireFox2、Sarafi3(windows version)、Opera9.2,
but it works in IE6.

my test case is :


<?xml version="1.0" encoding="UTF-8"?>
<databag>
<access>
<code>0</code>
<desc>success</desc>
</access>
<data>
<meta/>
<content><![CDATA[bhalhabhalha]]></content>
</data>
</databag>

var root = xmlDoc.documentElement || xmlDoc;
var q = Ext.DomQuery;
q.selectValue("/data/content", root, "");

jack.slocum
5 Jul 2007, 11:55 PM
Why is this reported as a bug? Is there anywhere in the documentation where it says it would?

ronnin
7 Jul 2007, 12:06 AM
With the greatest of pleasure, I could get the answer from Jack.

if Ext.DomQuery.selectValue() is not supposed to read CDATA node, is there another way to read it.

jack.slocum
7 Jul 2007, 10:07 AM
I haven't tried it. I take it you are trying to read the CDATA block into a store?

ronnin
7 Jul 2007, 5:21 PM
I take Ext.DomQuery as the Browser-independent DOM-parser, isn't it?
I'm just use it to parse a XML document.

in this case, I'm trying to read a CDATA block by it.

jack.slocum
7 Jul 2007, 6:20 PM
You can query for the node that contains the CDATA and then grab it from the node?