cesarmarinhorj / jsonpath

Automatically exported from code.google.com/p/jsonpath
0 stars 0 forks source link

access to element starting with @ #12

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
==call==
jsonPath(self, '$..DIV[?(@.@class==\'value\')]').length
==input==
var arr={ "DIV": [{"@class":"value","val":5}] };

What is the expected output? What do you see instead?
Expected 1, returned 0

What version of the product are you using? On what operating system?
jsonpath-0.8.0.js
¡Javascript!

Please provide any additional information below.
The problem is about notation. In the notation, "@" has the meaning of 
actual object but an attribute starting with "@" is handled as actual 
object. I suggest to change the "@" simbol for another that is reserved in 
XML.
I suggest to visit: "http://www.w3.org/TR/xml/#NT-NameChar" for change the 
symbol.

Original issue reported on code.google.com by carellan...@gmail.com on 13 Aug 2009 at 10:57