System.log error simplexml_load_string (Extra content at the end of the document)












2















System.log error



2016-02-04T03:16:25+00:00 ERR (3): Warning: simplexml_load_string(): Entity: line 9: parser error : Extra content at the end of the document  in /var/www/html/magento/app/code/core/Mage/Core/Model/Layout/Update.php on line 450
2016-02-04T03:16:25+00:00 ERR (3): Warning: simplexml_load_string(): <reference name="left"> in /var/www/html/magento/app/code/core/Mage/Core/Model/Layout/Update.php on line 450
2016-02-04T03:16:25+00:00 ERR (3): Warning: simplexml_load_string(): ^ in /var/www/html/magento/app/code/core/Mage/Core/Model/Layout/Update.php on line 450
2016-02-04T04:00:17+00:00 ERR (3): Warning: simplexml_load_string(): Entity: line 9: parser error : Extra content at the end of the document in /var/www/html/magento/app/code/core/Mage/Core/Model/Layout/Update.php on line 450
2016-02-04T04:00:17+00:00 ERR (3): Warning: simplexml_load_string(): <reference name="left"> in /var/www/html/magento/app/code/core/Mage/Core/Model/Layout/Update.php on line 450
2016-02-04T04:00:17+00:00 ERR (3): Warning: simplexml_load_string(): ^ in /var/www/html/magento/app/code/core/Mage/Core/Model/Layout/Update.php on line 450


this is my Update.php



 // 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();
Mage::log(print_r($filename, true));
}
$layoutXml = simplexml_load_string('<layouts>'.$layoutStr.'</layouts>',$elementClass);
return $layoutXml;
}


}










share|improve this question

























  • It means there is some tag error or extra invalid content in recently changed xml configuration.

    – Rohit Kundale
    Feb 4 '16 at 4:59
















2















System.log error



2016-02-04T03:16:25+00:00 ERR (3): Warning: simplexml_load_string(): Entity: line 9: parser error : Extra content at the end of the document  in /var/www/html/magento/app/code/core/Mage/Core/Model/Layout/Update.php on line 450
2016-02-04T03:16:25+00:00 ERR (3): Warning: simplexml_load_string(): &lt;reference name=&quot;left&quot;&gt; in /var/www/html/magento/app/code/core/Mage/Core/Model/Layout/Update.php on line 450
2016-02-04T03:16:25+00:00 ERR (3): Warning: simplexml_load_string(): ^ in /var/www/html/magento/app/code/core/Mage/Core/Model/Layout/Update.php on line 450
2016-02-04T04:00:17+00:00 ERR (3): Warning: simplexml_load_string(): Entity: line 9: parser error : Extra content at the end of the document in /var/www/html/magento/app/code/core/Mage/Core/Model/Layout/Update.php on line 450
2016-02-04T04:00:17+00:00 ERR (3): Warning: simplexml_load_string(): &lt;reference name=&quot;left&quot;&gt; in /var/www/html/magento/app/code/core/Mage/Core/Model/Layout/Update.php on line 450
2016-02-04T04:00:17+00:00 ERR (3): Warning: simplexml_load_string(): ^ in /var/www/html/magento/app/code/core/Mage/Core/Model/Layout/Update.php on line 450


this is my Update.php



 // 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();
Mage::log(print_r($filename, true));
}
$layoutXml = simplexml_load_string('<layouts>'.$layoutStr.'</layouts>',$elementClass);
return $layoutXml;
}


}










share|improve this question

























  • It means there is some tag error or extra invalid content in recently changed xml configuration.

    – Rohit Kundale
    Feb 4 '16 at 4:59














2












2








2








System.log error



2016-02-04T03:16:25+00:00 ERR (3): Warning: simplexml_load_string(): Entity: line 9: parser error : Extra content at the end of the document  in /var/www/html/magento/app/code/core/Mage/Core/Model/Layout/Update.php on line 450
2016-02-04T03:16:25+00:00 ERR (3): Warning: simplexml_load_string(): &lt;reference name=&quot;left&quot;&gt; in /var/www/html/magento/app/code/core/Mage/Core/Model/Layout/Update.php on line 450
2016-02-04T03:16:25+00:00 ERR (3): Warning: simplexml_load_string(): ^ in /var/www/html/magento/app/code/core/Mage/Core/Model/Layout/Update.php on line 450
2016-02-04T04:00:17+00:00 ERR (3): Warning: simplexml_load_string(): Entity: line 9: parser error : Extra content at the end of the document in /var/www/html/magento/app/code/core/Mage/Core/Model/Layout/Update.php on line 450
2016-02-04T04:00:17+00:00 ERR (3): Warning: simplexml_load_string(): &lt;reference name=&quot;left&quot;&gt; in /var/www/html/magento/app/code/core/Mage/Core/Model/Layout/Update.php on line 450
2016-02-04T04:00:17+00:00 ERR (3): Warning: simplexml_load_string(): ^ in /var/www/html/magento/app/code/core/Mage/Core/Model/Layout/Update.php on line 450


this is my Update.php



 // 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();
Mage::log(print_r($filename, true));
}
$layoutXml = simplexml_load_string('<layouts>'.$layoutStr.'</layouts>',$elementClass);
return $layoutXml;
}


}










share|improve this question
















System.log error



2016-02-04T03:16:25+00:00 ERR (3): Warning: simplexml_load_string(): Entity: line 9: parser error : Extra content at the end of the document  in /var/www/html/magento/app/code/core/Mage/Core/Model/Layout/Update.php on line 450
2016-02-04T03:16:25+00:00 ERR (3): Warning: simplexml_load_string(): &lt;reference name=&quot;left&quot;&gt; in /var/www/html/magento/app/code/core/Mage/Core/Model/Layout/Update.php on line 450
2016-02-04T03:16:25+00:00 ERR (3): Warning: simplexml_load_string(): ^ in /var/www/html/magento/app/code/core/Mage/Core/Model/Layout/Update.php on line 450
2016-02-04T04:00:17+00:00 ERR (3): Warning: simplexml_load_string(): Entity: line 9: parser error : Extra content at the end of the document in /var/www/html/magento/app/code/core/Mage/Core/Model/Layout/Update.php on line 450
2016-02-04T04:00:17+00:00 ERR (3): Warning: simplexml_load_string(): &lt;reference name=&quot;left&quot;&gt; in /var/www/html/magento/app/code/core/Mage/Core/Model/Layout/Update.php on line 450
2016-02-04T04:00:17+00:00 ERR (3): Warning: simplexml_load_string(): ^ in /var/www/html/magento/app/code/core/Mage/Core/Model/Layout/Update.php on line 450


this is my Update.php



 // 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();
Mage::log(print_r($filename, true));
}
$layoutXml = simplexml_load_string('<layouts>'.$layoutStr.'</layouts>',$elementClass);
return $layoutXml;
}


}







magento-1.9 layout error xml






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Feb 4 '16 at 21:56









Fabian Schmengler

54.8k21134348




54.8k21134348










asked Feb 4 '16 at 4:57









이시우이시우

66310




66310













  • It means there is some tag error or extra invalid content in recently changed xml configuration.

    – Rohit Kundale
    Feb 4 '16 at 4:59



















  • It means there is some tag error or extra invalid content in recently changed xml configuration.

    – Rohit Kundale
    Feb 4 '16 at 4:59

















It means there is some tag error or extra invalid content in recently changed xml configuration.

– Rohit Kundale
Feb 4 '16 at 4:59





It means there is some tag error or extra invalid content in recently changed xml configuration.

– Rohit Kundale
Feb 4 '16 at 4:59










3 Answers
3






active

oldest

votes


















3














The bug is not in Update.php but in your layout XML files. Conveniently, you or somebody else already added a line to debug: Mage::log(print_r($filename, true)); - if you move it 3 lines up, before the first simplexml_load_string(), you will get an additional line in system.log right before these errors that tells you which file it is. Remove the logging code afterwards!



From the error message, it is evident that you have added content to the end of a layout XML file, which results in invalid XML:



<?xml version="1.0"?>
<layout>
...
</layout>
<reference name="left">
^
|
this is where the parser fails


XML files must always have exactly one root element. Also, it would not make sense, to add layout instructions that are not within a layout handle. To add/change something in the left column on each page, your XML should look similar to this:



<?xml version="1.0"?>
<layout> <!-- mandatory root element -->
<default> <!-- the handle -->
<reference name="left">
...
</reference>
</default>
</layout>





share|improve this answer


























  • You're the man @Fabian

    – Tahir Yasin
    Sep 16 '18 at 15:07



















1














The error is an indication of xml tag mismatching that happend somwhere in your layout update xml files.



Just go and check those layout update xml files that you have recently edited and correct those mistakes.






share|improve this answer































    1














    There is some XML that has been added custom to either local.xml or some other xml (recent changes)



    <reference name="left"></reference>


    From the error, it says there is ADDITIONAL content at the end or beginning of this tag (some custom change). Check that.



    This is causing the problem.






    share|improve this answer

























      Your Answer








      StackExchange.ready(function() {
      var channelOptions = {
      tags: "".split(" "),
      id: "479"
      };
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function() {
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled) {
      StackExchange.using("snippets", function() {
      createEditor();
      });
      }
      else {
      createEditor();
      }
      });

      function createEditor() {
      StackExchange.prepareEditor({
      heartbeatType: 'answer',
      autoActivateHeartbeat: false,
      convertImagesToLinks: false,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: null,
      bindNavPrevention: true,
      postfix: "",
      imageUploader: {
      brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
      contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
      allowUrls: true
      },
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      });


      }
      });














      draft saved

      draft discarded


















      StackExchange.ready(
      function () {
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f100281%2fsystem-log-error-simplexml-load-string-extra-content-at-the-end-of-the-document%23new-answer', 'question_page');
      }
      );

      Post as a guest















      Required, but never shown

























      3 Answers
      3






      active

      oldest

      votes








      3 Answers
      3






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      3














      The bug is not in Update.php but in your layout XML files. Conveniently, you or somebody else already added a line to debug: Mage::log(print_r($filename, true)); - if you move it 3 lines up, before the first simplexml_load_string(), you will get an additional line in system.log right before these errors that tells you which file it is. Remove the logging code afterwards!



      From the error message, it is evident that you have added content to the end of a layout XML file, which results in invalid XML:



      <?xml version="1.0"?>
      <layout>
      ...
      </layout>
      <reference name="left">
      ^
      |
      this is where the parser fails


      XML files must always have exactly one root element. Also, it would not make sense, to add layout instructions that are not within a layout handle. To add/change something in the left column on each page, your XML should look similar to this:



      <?xml version="1.0"?>
      <layout> <!-- mandatory root element -->
      <default> <!-- the handle -->
      <reference name="left">
      ...
      </reference>
      </default>
      </layout>





      share|improve this answer


























      • You're the man @Fabian

        – Tahir Yasin
        Sep 16 '18 at 15:07
















      3














      The bug is not in Update.php but in your layout XML files. Conveniently, you or somebody else already added a line to debug: Mage::log(print_r($filename, true)); - if you move it 3 lines up, before the first simplexml_load_string(), you will get an additional line in system.log right before these errors that tells you which file it is. Remove the logging code afterwards!



      From the error message, it is evident that you have added content to the end of a layout XML file, which results in invalid XML:



      <?xml version="1.0"?>
      <layout>
      ...
      </layout>
      <reference name="left">
      ^
      |
      this is where the parser fails


      XML files must always have exactly one root element. Also, it would not make sense, to add layout instructions that are not within a layout handle. To add/change something in the left column on each page, your XML should look similar to this:



      <?xml version="1.0"?>
      <layout> <!-- mandatory root element -->
      <default> <!-- the handle -->
      <reference name="left">
      ...
      </reference>
      </default>
      </layout>





      share|improve this answer


























      • You're the man @Fabian

        – Tahir Yasin
        Sep 16 '18 at 15:07














      3












      3








      3







      The bug is not in Update.php but in your layout XML files. Conveniently, you or somebody else already added a line to debug: Mage::log(print_r($filename, true)); - if you move it 3 lines up, before the first simplexml_load_string(), you will get an additional line in system.log right before these errors that tells you which file it is. Remove the logging code afterwards!



      From the error message, it is evident that you have added content to the end of a layout XML file, which results in invalid XML:



      <?xml version="1.0"?>
      <layout>
      ...
      </layout>
      <reference name="left">
      ^
      |
      this is where the parser fails


      XML files must always have exactly one root element. Also, it would not make sense, to add layout instructions that are not within a layout handle. To add/change something in the left column on each page, your XML should look similar to this:



      <?xml version="1.0"?>
      <layout> <!-- mandatory root element -->
      <default> <!-- the handle -->
      <reference name="left">
      ...
      </reference>
      </default>
      </layout>





      share|improve this answer















      The bug is not in Update.php but in your layout XML files. Conveniently, you or somebody else already added a line to debug: Mage::log(print_r($filename, true)); - if you move it 3 lines up, before the first simplexml_load_string(), you will get an additional line in system.log right before these errors that tells you which file it is. Remove the logging code afterwards!



      From the error message, it is evident that you have added content to the end of a layout XML file, which results in invalid XML:



      <?xml version="1.0"?>
      <layout>
      ...
      </layout>
      <reference name="left">
      ^
      |
      this is where the parser fails


      XML files must always have exactly one root element. Also, it would not make sense, to add layout instructions that are not within a layout handle. To add/change something in the left column on each page, your XML should look similar to this:



      <?xml version="1.0"?>
      <layout> <!-- mandatory root element -->
      <default> <!-- the handle -->
      <reference name="left">
      ...
      </reference>
      </default>
      </layout>






      share|improve this answer














      share|improve this answer



      share|improve this answer








      edited Feb 5 '16 at 0:05

























      answered Feb 4 '16 at 21:54









      Fabian SchmenglerFabian Schmengler

      54.8k21134348




      54.8k21134348













      • You're the man @Fabian

        – Tahir Yasin
        Sep 16 '18 at 15:07



















      • You're the man @Fabian

        – Tahir Yasin
        Sep 16 '18 at 15:07

















      You're the man @Fabian

      – Tahir Yasin
      Sep 16 '18 at 15:07





      You're the man @Fabian

      – Tahir Yasin
      Sep 16 '18 at 15:07













      1














      The error is an indication of xml tag mismatching that happend somwhere in your layout update xml files.



      Just go and check those layout update xml files that you have recently edited and correct those mistakes.






      share|improve this answer




























        1














        The error is an indication of xml tag mismatching that happend somwhere in your layout update xml files.



        Just go and check those layout update xml files that you have recently edited and correct those mistakes.






        share|improve this answer


























          1












          1








          1







          The error is an indication of xml tag mismatching that happend somwhere in your layout update xml files.



          Just go and check those layout update xml files that you have recently edited and correct those mistakes.






          share|improve this answer













          The error is an indication of xml tag mismatching that happend somwhere in your layout update xml files.



          Just go and check those layout update xml files that you have recently edited and correct those mistakes.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Feb 4 '16 at 6:33









          Rajeev K TomyRajeev K Tomy

          14.6k54589




          14.6k54589























              1














              There is some XML that has been added custom to either local.xml or some other xml (recent changes)



              <reference name="left"></reference>


              From the error, it says there is ADDITIONAL content at the end or beginning of this tag (some custom change). Check that.



              This is causing the problem.






              share|improve this answer






























                1














                There is some XML that has been added custom to either local.xml or some other xml (recent changes)



                <reference name="left"></reference>


                From the error, it says there is ADDITIONAL content at the end or beginning of this tag (some custom change). Check that.



                This is causing the problem.






                share|improve this answer




























                  1












                  1








                  1







                  There is some XML that has been added custom to either local.xml or some other xml (recent changes)



                  <reference name="left"></reference>


                  From the error, it says there is ADDITIONAL content at the end or beginning of this tag (some custom change). Check that.



                  This is causing the problem.






                  share|improve this answer















                  There is some XML that has been added custom to either local.xml or some other xml (recent changes)



                  <reference name="left"></reference>


                  From the error, it says there is ADDITIONAL content at the end or beginning of this tag (some custom change). Check that.



                  This is causing the problem.







                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited 35 mins ago









                  Teja Bhagavan Kollepara

                  2,98641947




                  2,98641947










                  answered Feb 4 '16 at 6:16









                  ShivaniShivani

                  51125




                  51125






























                      draft saved

                      draft discarded




















































                      Thanks for contributing an answer to Magento Stack Exchange!


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid



                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.


                      To learn more, see our tips on writing great answers.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function () {
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f100281%2fsystem-log-error-simplexml-load-string-extra-content-at-the-end-of-the-document%23new-answer', 'question_page');
                      }
                      );

                      Post as a guest















                      Required, but never shown





















































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown

































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown







                      Popular posts from this blog

                      What other Star Trek series did the main TNG cast show up in?

                      Berlina muro

                      Berlina aerponto