blongden/hal — pull request #7 by ramsey (2012-09-06 19:26:12+00:00)
Title: Numeric-indexed arrays now use parent key name as element name

Fixing bug where numeric-indexed arrays were added to XML with numeric element names. They should have been using the parent name as the element name.

I ran into a case, where I was getting the following XML output:

```xml

<0>bar
<1>baz

```

While the JSON output looked fine:

```json
{
"foo": [
"bar",
"baz"
],
"_links": {
"self": {
"href": "/foobar"
}
}
}
```

This pull request corrects the issue so that the XML output now appears like this:

```xml

bar
baz

```

Here is a PHP script to reproduce the issue:

```php
$hal = new \Nocarrier\Hal('/foobar', array(
'foo' => array(
'bar',
'baz'
),
));

echo $hal->asXml(true);
echo $hal->asJson(true);
```