The question:
I get the following repeated a lot in magento 1.9.1.1 system.log. any ideas?
2015-05-17T09:17:55+00:00 ERR (3): Warning: simplexml_load_string() [<a href='function.simplexml-load-string'>function.simplexml-load-string</a>]: </layout> in /home/x/public_html/includes/src/__default.php on line 28961
2015-05-17T09:17:55+00:00 ERR (3): Warning: simplexml_load_string() [<a href='function.simplexml-load-string'>function.simplexml-load-string</a>]: ^ in /home/x/public_html/includes/src/__default.php on line 28961
_default code
// custom local layout updates file - load always last
$updateFiles[] = 'local.xml';
$layoutStr = '';
foreach ($updateFiles as $file) {
$filename = $design->getLayoutFilename($file, array(
'_area' => $area,
'_package' => $package,
'_theme' => $theme
));
if (!is_readable($filename)) {
continue;
}
$fileStr = file_get_contents($filename);
$fileStr = str_replace($this->_subst['from'], $this->_subst['to'], $fileStr);
$fileXml = simplexml_load_string($fileStr, $elementClass);
if (!$fileXml instanceof SimpleXMLElement) {
continue;
}
$layoutStr .= $fileXml->innerXml();
}
$layoutXml = simplexml_load_string('<layouts>'.$layoutStr.'</layouts>', $elementClass);
return $layoutXml;
}
}
My local XML
<?xml version="1.0"?>
<layout version="0.1.0">
<default>
<reference name="footer_links">
<remove name="return_link"/>
<action method="removeLinkByUrl"><url helper="catalogsearch/getSearchTermUrl" /></action>
<action method="removeLinkByUrl"><url helper="catalogsearch/getAdvancedSearchUrl" /></action>
</reference>
<checkout_cart_index>
<reference name="content">
<block name="checkout.cart">
<remove name="checkout.cart.shipping"/>
</block>
</reference>
</checkout_cart_index>
<checkout_cart_index>
<reference name="content">
<block name="checkout.cart">
<remove name="checkout.cart.coupon"/>
</block>
</reference>
</checkout_cart_index>
<catalog_product_view>
<reference name="product.info.additional">
<action method="unsetChild"><name>product_tag_list</name></action>
</reference>
</catalog_product_view>
</default>
</layout>
The Solutions:
Below are the methods you can try. The first solution is probably the best. Try others if the first one doesn’t work. Senior developers aren’t just copying/pasting – they read the methods carefully & apply them wisely to each case.
Method 1
One of your XML files is broken, use this command to find it:
cd /your/magento/root/dir
find . -type f -name "*.xml" -exec xmllint --noout {} ;
(I hope your on a *nix)
Method 2
Not sure if this is the real problem, but your local.xml
looks a bit weird. Try this one:
<?xml version="1.0"?>
<layout version="0.1.0">
<default>
<reference name="footer_links">
<remove name="return_link"/>
<action method="removeLinkByUrl">
<url helper="catalogsearch/getSearchTermUrl"/>
</action>
<action method="removeLinkByUrl">
<url helper="catalogsearch/getAdvancedSearchUrl"/>
</action>
</reference>
</default>
<checkout_cart_index>
<remove name="checkout.cart.shipping"/>
<remove name="checkout.cart.coupon"/>
</checkout_cart_index>
<catalog_product_view>
<reference name="product.info.additional">
<action method="unsetChild">
<name>product_tag_list</name>
</action>
</reference>
</catalog_product_view>
</layout>
Besides of that, make sure that there are no invalid XML files. Therefore, use an unchanged default theme and try to disable all third party extensions.
All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0