Opened 14 years ago

Closed 14 years ago

Last modified 12 years ago

#4030 closed defect (wontfix)

dojo.query () Drops Case

Reported by: guest Owned by: alex
Priority: high Milestone: 0.9
Component: Query Version: 0.9
Keywords: Cc: [email protected]
Blocked By: Blocking:


I'm running in to a problem with dojo.query() where it's dropping the case when I'm doing XML parsing. For example, I have an XML file that contains:


If I do a dojo.query("Result"), an empty list is returned. On the other hand, if I do a .getElementsByTagName("Result"), I do get a proper array.

I'm working on the 0.9 beta, but the problem still exists in the nightly as of Aug-5.



Change History (4)

comment:1 Changed 14 years ago by dylan

Milestone: 0.9
Owner: changed from anonymous to alex

comment:2 Changed 14 years ago by alex

this is slightly more involved than it looks at first glance. dojo.query() isn't designed to support XML documents, but it appears to across browsers without incident, modulo this finding. Notably, the current behavior forces all tag names to be lower-case, so if your markup were: {{{<resultset>

<result>One</result> <result>Two</result>

</resultset>}}} you'd be able to query it today. Removing the tagname case-forcing will cause subtle inconsistencies in HTML queries when the engine automatically switches to the XPath branch to service queries for which it's best suited. The short term solution (and the one I think we're going to go with here) is to just say "query with correct case" and remove the normalization so that the issue reported here is fixed. Longer term, we should probably try to force xpath evaluation against XML documents in all cases (including on IE where there's a reasonable implementation).

I'm very worried that removing the case downshift is going to subtly break people, but we'll just have to throw it out there and see.

comment:3 Changed 14 years ago by alex

Resolution: wontfix
Status: newclosed

looking at the issue (and the code) more, I think this isn't tractable as I thought it might have been. I think that we're only going to support XML w/ lower-case tag names. Any other solution is going to compromise the speed and compatibility of the system in ways which I'm deeply uncomfortable with. Marking "wontfix" since XML parsing was never a first-class priority in any case.

comment:4 Changed 12 years ago by bill

Component: GeneralQuery
Note: See TracTickets for help on using tickets.