2

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>]: &lt;/layout&gt;  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>

2 Answers 2

7

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)

8
  • 1
    You will find using Linux for development and xmllint are your best buds when tracking down broken xml files... Same goes for Mac, as OS X is a *nix variant. Commented Jul 19, 2015 at 17:56
  • I got tons of these finds ./app/code/core/Mage/Tag/etc/wsi.xml:2: namespace error : xmlns:typens: 'urn:{{var wsdl.name}}' is not a valid URI <wsdl:definitions xmlns:typens="urn:{{var wsdl.name}}" ^ ./app/code/core/Mage/Checkout/etc/wsdl.xml:2: namespace error : xmlns:typens: 'urn:{{var wsdl.name}}' is not a valid URI <definitions xmlns:typens="urn:{{var wsdl.name}}" xmlns:xsd="w3.org/2 ./app/code/core/Mage/Downloadable/etc/wsi.xml:2: namespace error : xmlns:typens: 'urn:{{var wsdl.name}}' is not a valid URI <wsdl:def etc
    – Vygantas
    Commented Jul 20, 2015 at 7:02
  • these are ok :) namespace errors can be ignores Commented Jul 20, 2015 at 7:12
  • But there should be something about one of the layout xml files Commented Jul 20, 2015 at 7:13
  • @FabianBlechschmidt thanks for your answer, above gives ./core/Mage/Sales/etc/wsdl.xml:2: namespace error : xmlns:typens: 'urn:{{var wsdl.name}}' is not a valid URI <definitions xmlns:typens="urn:{{var wsdl.name}}" xmlns:xsd="http://www.w3.org/2 any idea about this?
    – Anto S
    Commented Apr 27, 2016 at 10:46
3

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.

2
  • Nope, still same
    – Vygantas
    Commented May 17, 2015 at 17:42
  • As said, then you can check if it also happens with a standard theme and if it still occurs, disable each extension and see if that helps.
    – Simon
    Commented May 17, 2015 at 17:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.