Tencent / rapidjson

A fast JSON parser/generator for C++ with both SAX/DOM style API
http://rapidjson.org/
Other
14.19k stars 3.53k forks source link

Can't get object from node!! #2209

Closed dangdkhanh closed 1 year ago

dangdkhanh commented 1 year ago

Hi,

My json snippet is as follows:

Screenshot_4

"Quận": {
        "Thanh Xuân": {
                   "Phường": [
                         "Khương Mai",
                         "Thanh Xuân Bắc"
                   ],
          },
          "Tây Hồ": {..},
        ...
 },

Using the .Findmember method I can retrieve the object ( "Thanh Xuân") and check for .Name as expected.

huyen_node->value returns objecttype however as you can see there is nothing in object ( "Thanh Xuân"). (expected return: "Phường")

Screenshot_6

Screenshot_7

Is there anything wrong here?

Thanks for explain!

dangdkhanh commented 1 year ago

Hi, The reason seems to be that I was accessing this node from outside the loop and then it was not allowing access inside. I will change the approach and maybe it will work.