symfony/symfony — pull request #9350 by sandermarechal (2013-10-20 12:35:24+00:00)
Title: [DependencyInjection] Use DOM instead of SimpleXML for namespace support

| Q | A
| ------------- | ---
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #9345
| License | MIT
| Doc PR |

This PR makes the XmlFileLoader use the DOM instead of SimpleXML. This allows full namespace support in XML files. Previously, the Symfony container namespace had to be the default namespace for the document. See also #9345.

Some things to discuss:

I avoided any BC breaks but I do not know if the things I avoided breaking are actually part of the API. There are two places this applies to:

1. The `Symfony\Component\DependencyInjection\SimpleXMLElement` still exists, but it is no longer used, except to maintain BC. It does not appear to be used anywhere else in Symfony itself. Maybe some userland code uses it somewhere. If this is not part of the API it could be removed.
2. The `parseFile` method still returns a SimpleXMLElement to maintain BC. I have added a new function `parseFileToDOM` that is used by the XmlFileLoader itself. If this is not part of the API we could drop that new function and have `parseFile` return a `\DOMDocument` instead.