branko ajzele, senior developer / project manager

Posts / Articles

Warning: SimpleXMLElement::addAttribute() [simplexmlelement.addattribute]: Attribute already exists

I’ll be short on this one. For those of you in Magento theme developement, if you ever see this message

Warning: SimpleXMLElement::addAttribute() [simplexmlelement.addattribute]: Attribute already exists

Most likely you have layout problem. So dive into your theme /layout folder and quick check to see if it relly is the messed up layout in your theme is to rename entire /layout folder to something like /_layout. This way Magento will propagate to using default theme /layout folder. If the refresehed page now works, you located the error to be in /layout folder. Now do the same for few of the files inside the layout folder.

In my example I have added the following into catalog.xml under section

<remove name=”tags_popular” />

And that caused my Customer page to be broken after customer logs in.

Hope this help someone.

View Comments

  1. Thanks a lot, this got me focussed on the tags from which one caused the problem described in your post.

    Warning: SimpleXMLElement::addAttribute() [simplexmlelement.addattribute]: Attribute already exists

    on Layout.php line 165.

    Again, thanks.

    Kind regards,

    Pim Schaaf

  2. Nice to see this post helped someone :)

  3. Lee Saferite /

    Wow. A year later and this BUG is still in Magento… how disappointing.

  4. Lee Saferite /

    Wow. A year later and this BUG is still in Magento… how disappointing.

Trackbacks/Pingbacks

  1. Magento: Error - SimpleXMLElement::addAttribute() Attribute already exists - [...] need to give thanks to Branko Ajzele for his post. It helped me realize what the problem [...]
blog comments powered by Disqus