Normally I would use jQuery to get data from listdata.svc like this:
$.getJSON(listUrl,
function (data) {
$.each(data.d.results,
function (i, result) {
A little clarification. This is my data source:
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<feed xml:base="http://contoso/_vti_bin/listdata.svc/">
<title type="text">UnitsUnit</title>
<id>http://contoso/_vti_bin/listdata.svc/UnitsUnit</id>
<entry m:etag="W/"5"">
<id>http://contoso/_vti_bin/listdata.svc/UnitsUnit(1)</id>
<title type="text">This is the normal title ...</title>
<link rel="..." title="..." href="..." />
<link rel="..." title="..." href="..." />
<m:inline>
<feed>
<title type="text">Subunits</title>
<id>http://contoso/_vti_bin/listdata.svc/UnitsUnit(1)/Subunits</id>
<updated>2013-12-04T08:37:07Z</updated>
<link rel="self" title="Subunits" href="UnitsUnit(1)/Subunits" />
<entry m:etag="W/"5"">
<id>http://contoso/_vti_bin/listdata.svc/Units(15)</id>
<title type="text">**I NEED THIS TITLE**</title>
<link rel="..." title="..." href="..." />
<link rel="..." title="..." href="..." />
<content type="application/xml">
<m:properties>
<d:....>.....</d:....>
<d:....>.....</d:....>
</m:properties>
</content>
</entry>
<entry m:etag="W/"9"">
<id>http://contoso/_vti_bin/listdata.svc/Units(16)</id>
<title type="text">**AND I NEED THIS TITLE**</title>
<link rel="..." title="..." href="..." />
<link rel="..." title="..." href="..." />
<category term="Microsoft.SharePoint.DataService.UnitsItem" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" />
<content type="application/xml">
<m:properties>
<d:....>.....</d:....>
<d:....>.....</d:....>
</m:properties>
</content>
</entry>
</feed>
</m:inline>
</link>
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/OprettetAf" type="application/atom+xml;type=entry" title="OprettetAf" href="UnitsUnit(1)/OprettetAf" />
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/ÆndretAf" type="application/atom+xml;type=entry" title="ÆndretAf" href="UnitsUnit(1)/ÆndretAf" />
<content type="application/xml">
<m:properties>
<d:Title>I don't need this one ...</d:Title>
<d:UnitId m:type="Edm.Int32">8</d:EnhedId>
</m:properties>
</content>
</entry>
</feed>
I need the titles from the m:inline > feed > entry > title ...
Update: Using console.log(JSON.stringify(data.d.results)) yields this object:
LOG: [{
"__metadata":{...},
"ContentTypeId":"0x0100A9CFFA37DE22C641B71785403A8E5571",
"Title":"This title is what i get with data.d.results[i].Title",
"Unit":{"__deferred":{"uri":"..."}},
"UnitId":8,
"Subunits":{
"results":[{
"__metadata":{...},
"ContentTypeId":"0x01009D2BABDBD41F8543A022ECD6225898E4",
"Title":"This title is what I need",
"Path":"..."},
{"__metadata":{...},
"ContentTypeId":"0x01009D2BABDBD41F8543A022ECD6225898E4",
"Title":"And this one",
...