bbenet / json-path

Automatically exported from code.google.com/p/json-path
0 stars 0 forks source link

Incorrect evaluation on array of array #38

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Given the following json object:
{
   "datapoints":[
      [
         10.1,
         13.0
      ],
      [
         21.0,
         22.0
      ]
   ]
}

2. apply json path expression: $.datapoints.[*].[0]

What is the expected output? What do you see instead?
1) Expected output (try http://ashphy.com/JSONPathOnlineEvaluator/):
   '0' => "10.1"
   '1' => "21.0"
2) Got below instead:
   '0' => "21.0"
   '1' => "22.0"

What version of the product are you using? On what operating system?
Both version 0.5 & 0.9. OS -linux

Please provide any additional information below.
Using a similar XML and apply XPath expression 
//response/datapoints/values/value[1] produced result agreed with the expected 
output.

XML:
<response>
   <datapoints>
      <values>
         <value>10.1</value>
         <value>13.0</value>
      </values>
      <values>
         <value>21.0</value>
         <value>22.0</value>
      </values>
   </datapoints>
</response>

Apply XPath expr: //response/datapoints/values/value[1]:
Element='<value>10.1</value>'
Element='<value>21.0</value>'

Online XPath evaluator: http://www.freeformatter.com/xpath-tester.html#ad-output

Original issue reported on code.google.com by danielch...@gmail.com on 9 Oct 2013 at 10:39

GoogleCodeExporter commented 8 years ago
Fixed in 1.0

Original comment by kalle.st...@gmail.com on 12 Dec 2013 at 9:56

GoogleCodeExporter commented 8 years ago
Works in v 1.0 (soon to be released)

Original comment by kalle.st...@gmail.com on 18 Sep 2014 at 5:38