Getting complex attribute value of object
<p>Given json like this :</p>

<pre><code>{ "rss": {
   "page": 1,
   "results": [{
      "type": "text",
      "$": 10
   }],
   "text": [{
      "content": "Lorem ipsum dolor sit amet.",
      "author": {
         "name": "Cesar",
         "email": "cesar@evoria.com"
      },
   },
   {
      "content": "Tema Tis rolod muspi merol.",
      "author": {
         "name": "Cleopatre",
         "email": "cleopatre@pyramid.com"
      },
   }]
}
</code></pre>

<p>In javascript, I can retrieve value like this :</p>

<pre><code>var json = JSON.parse(datajson);
$.each(json.text, function(key, val) {
    // this one is ok
    var content = val['content'];
    // this one does not work
    var authorname = val['author.name'];
});
</code></pre>

<p>Is this a way, given the attribute name in a string format, to retrieve the value of a complex object, for instance <code>json.text[0].author.name</code>?</p>

<p><strong>EDIT</strong>
I would like to store the needed attributes in another object like :</p>

<pre><code>[
    { dt: "Text content", dd: "content" },
    { dt: "Author name", dd: "author.name"}
]
</code></pre>
