diff --git a/lib/Doctrine/ORM/Mapping/Driver/XmlDriver.php b/lib/Doctrine/ORM/Mapping/Driver/XmlDriver.php
index ab8e3b780..20631d63c 100644
--- a/lib/Doctrine/ORM/Mapping/Driver/XmlDriver.php
+++ b/lib/Doctrine/ORM/Mapping/Driver/XmlDriver.php
@@ -322,8 +322,8 @@ class XmlDriver extends AbstractFileDriver
$mapping['orderBy'] = $orderBy;
}
- if (isset($oneToManyElement->{'index-by'})) {
- $mapping['indexBy'] = (string)$oneToManyElement->{'index-by'};
+ if (isset($oneToManyElement['index-by'])) {
+ $mapping['indexBy'] = (string)$oneToManyElement['index-by'];
}
$metadata->mapOneToMany($mapping);
diff --git a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.ORM.Mapping.User.dcm.xml b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.ORM.Mapping.User.dcm.xml
index 524b2494f..f116fb0fe 100644
--- a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.ORM.Mapping.User.dcm.xml
+++ b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.ORM.Mapping.User.dcm.xml
@@ -39,7 +39,7 @@
-
+