<div dir="ltr"><div class="gmail_extra"><div>Good evening,</div><div><br></div><div><br></div><div>Let's take this example from the mailing-list:</div><div><br></div><div><span class="" style="white-space:pre">    </span><font size="1">{ "Shape":</font></div><div><font size="1"><span class="" style="white-space:pre">            </span>{</font></div><div><font size="1"><span class="" style="white-space:pre">                      </span>"-content": [</font></div><div><font size="1"><span class="" style="white-space:pre">                                </span>{ "#comment":"Sphere begin"},</font></div><div><font size="1"><span class="" style="white-space:pre">                              </span>{ "Sphere":</font></div><div><font size="1"><span class="" style="white-space:pre">                                  </span>{</font></div><div><font size="1"><span class="" style="white-space:pre">                                      </span>}</font></div><div><font size="1"><span class="" style="white-space:pre">                              </span>},</font></div><div><font size="1"><span class="" style="white-space:pre">                             </span>{ "#comment":"Sphere complete, Appearance begin"},</font></div><div><font size="1"><span class="" style="white-space:pre">                         </span>{ "Appearance":</font></div><div><font size="1"><span class="" style="white-space:pre">                                      </span>{</font></div><div><font size="1"><span class="" style="white-space:pre">                                              </span>"-content": [</font></div><div><font size="1"><span class="" style="white-space:pre">                                                        </span>{ "#comment":"Material begin"},</font></div><div><font size="1"><span class="" style="white-space:pre">                                                    </span>{ "Material":</font></div><div><font size="1"><span class="" style="white-space:pre">                                                        </span>{</font></div><div><font size="1"><span class="" style="white-space:pre">                                                              </span>"@DEF":"MaterialLightBlue",</font></div><div><font size="1"><span class="" style="white-space:pre">                                                                </span>"@diffuseColor":[0.1,0.5,1]</font></div><div><font size="1"><span class="" style="white-space:pre">                                                  </span>}</font></div><div><font size="1"><span class="" style="white-space:pre">                                                      </span>},</font></div><div><font size="1"><span class="" style="white-space:pre">                                                     </span>{ "#comment":"Material complete, ImageTexture begin"},</font></div><div><font size="1"><span class="" style="white-space:pre">                                                     </span>{ "ImageTexture":</font></div><div><font size="1"><span class="" style="white-space:pre">                                                            </span>{</font></div><div><font size="1"><span class="" style="white-space:pre">                                                                      </span>"@DEF":"ImageCloudlessEarth",</font></div><div><font size="1"><span class="" style="white-space:pre">                                                                      </span>"@url":["earth-topo.png”]</font></div><div><font size="1"><span class="" style="white-space:pre">                                                             </span>}</font></div><div><font size="1"><span class="" style="white-space:pre">                                                      </span>},</font></div><div><font size="1"><span class="" style="white-space:pre">                                                     </span>{ "#comment":"ImageTexture complete"}</font></div><div><font size="1"><span class="" style="white-space:pre">                                              </span>]</font></div><div><font size="1"><span class="" style="white-space:pre">                                      </span>}</font></div><div><font size="1"><span class="" style="white-space:pre">                              </span>},</font></div><div><font size="1"><span class="" style="white-space:pre">                             </span>{ "#comment":"Appearance complete"}</font></div><div><font size="1"><span class="" style="white-space:pre">                        </span>]</font></div><div><font size="1"><span class="" style="white-space:pre">              </span>}</font></div><div><font size="1"><span class="" style="white-space:pre">      </span>}</font></div><div><br></div><div>Given a reference "data" to the root of the structure, you would have to use this to access the color:</div><div> "<b>data.Shape['-content'][3].Appearance['-content'][1].Material['@diffuseColor']</b>"</div><div>which is quite a mouthful.</div><div><br></div><div><br></div><div>Compare to this JSON5 structure instead:</div><div><br></div><div><span class="" style="white-space:pre">     </span><font size="1">{</font></div><div><font size="1"><span class="" style="white-space:pre">               </span>"$": "Shape",</font></div><div><font size="1"><br></font></div><div><font size="1"><span class="" style="white-space:pre">         </span>// Sphere begins</font></div><div><font size="1"><span class="" style="white-space:pre">               </span>"geometry": {</font></div><div><font size="1"><span class="" style="white-space:pre">                        </span>"$": "Sphere"</font></div><div><font size="1"><span class="" style="white-space:pre">              </span>},</font></div><div><span class="" style="font-size:x-small;white-space:pre"><br></span></div><div><span class="" style="font-size:x-small;white-space:pre">         </span><span style="font-size:x-small">// Sphere complete, Appearance begin</span><br></div><div><font size="1"><span class="" style="white-space:pre">         </span>"appearance": {</font></div><div><font size="1"><span class="" style="white-space:pre">                      </span>"$": "Appearance",</font></div><div><font size="1"><span class="" style="white-space:pre">                 </span>"material": {</font></div><div><font size="1"><span class="" style="white-space:pre">                                </span>"$": "Material",</font></div><div><font size="1"><span class="" style="white-space:pre">                           </span>"$DEF": "MaterialLightBlue",</font></div><div><font size="1"><span class="" style="white-space:pre">                               </span>"diffuseColor": [0.1, 0.5, 1]</font></div><div><font size="1"><span class="" style="white-space:pre">                        </span>},</font></div><div><font size="1"><br></font></div><div><font size="1"><span class="" style="white-space:pre">                        </span>// Material complete, ImageTexture begin</font></div><div><font size="1"><span class="" style="white-space:pre">                       </span>"texture": {</font></div><div><font size="1"><span class="" style="white-space:pre">                         </span>"$": "ImageTexture",</font></div><div><font size="1"><span class="" style="white-space:pre">                               </span>"$DEF": "ImageCloudlessEarth",</font></div><div><font size="1"><span class="" style="white-space:pre">                             </span>"url": ["earth-topo.png"]</font></div><div><font size="1"><span class="" style="white-space:pre">                  </span>}</font></div><div><font size="1"><span class="" style="white-space:pre">                      </span>// ImageTexture complete</font></div><div><font size="1"><span class="" style="white-space:pre">               </span>}</font></div><div><font size="1"><span class="" style="white-space:pre">              </span>// Appearance complete</font></div><div><font size="1"><span class="" style="white-space:pre"> </span>}</font></div><div><br></div><div>This time, you can access the color simply using: "<b>data.appearance.material.diffuseColor</b>".</div><div><br></div><div><br></div><div>See you,</div><div>Cecile</div></div></div>