#7205 closed defect (fixed)
dojo.query fails to detect case sensitive document on ff3
Reported by: | ptwobrussell | Owned by: | alex |
---|---|---|---|
Priority: | high | Milestone: | 1.2 |
Component: | Query | Version: | 1.1.1 |
Keywords: | Cc: | [email protected]… | |
Blocked By: | Blocking: |
Description
Currently in r14444, I'm finding that dojo.query fails if you provide an xml document context that has tags in all lower case. If you track it down, you find that it's because caseSensitive=false when qparts is returned so even though you might be querying for "foo", it gets normalized to "FOO", which doesn't exist in the document; rather, "foo" exists in the document.
It seems that caseSensitive is determined around line 1224 and the issue that I'm seeing is that od.ownerDocument is undefined, which results in the caseSensitive = (!!od) && (d.isIE ? od.xml : od.xmlVersion);
expression evaulating to false when it should be evaulating to true
I have no idea if this is a good idea or not, but it seems that you might check if od.contentType equals "application/xml" or if od.xmlVersion is defined or something along those lines to clear this up?
For a test doc, I'm finding that something as simple as
<?xml version="1.0" encoding="UTF-8"?> <foo><bar id="blarg" /></foo>
allows you to reproduce this issue. So, load that document up with something like the following to reproduce:
var dfd = dojo.xhrGet({ url : "foo.xml", handleAs : "xml" }); dfd.addCallback(function(response, io) { console.log(dojo.query("foo", response)); return response; });
Change History (5)
comment:1 Changed 13 years ago by
comment:2 Changed 13 years ago by
Owner: | changed from anonymous to alex |
---|
comment:3 Changed 13 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:4 Changed 13 years ago by
Milestone: | tbd → 1.2 |
---|
comment:5 Changed 11 years ago by
Component: | Core → Query |
---|
And by
od.contentType
, I actually meantroot.contentType
.So, for example, this works though it might not best the best idea in the world: