ZF-7010: Provide element name and allow same node in Zend_Config_Xml


  • Would be good to be able to access the node name in a Zend_Config_Xml loaded Zend_Config
  • Zend_Config is very inconsistent when it comes to having same node names like: </mynodes vs.

In the second case Zend_Config flattens the xml. As a result there is no way for a programmer to figure out if "mynode" is one subelement - where there could be many of them - or if its an attribute. Using foreach() results in iterating either over 2 "mynode" elements (in the first case) or over the attributes/subnodes of "mynode" in the second case!

I know its a restriction in Zend_Config_Xml and one should use different node names within node containers, but actually its very common to have this type of XML so the XML can be validated against XSD/DTD and is a lot easier to understand. As there is also no way to access the node name there is absolutely no use to have different node names. I'm really surprised to see that behavior. Is there any way of having this fixed?


Duplicate of ZF-6109