0

I am learning about widgets through this link. I have done everything as mentioned in that link but still I can't see my widget in admin panel..

I observed some error logs in var/log/system.log file which are as follows:

2013-10-03T06:56:53+00:00 ERR (3): Warning: simplexml_load_string() [function.simplexml-load-string]: Entity: line 1: parser error : XML declaration allowed only at the start of the document in C:\xampp\htdocs\magento\lib\Varien\Simplexml\Config.php on line 510 2013-10-03T06:56:53+00:00 ERR (3): Warning: simplexml_load_string() [function.simplexml-load-string]: <?xml version="1.0"?> in C:\xampp\htdocs\magento\lib\Varien\Simplexml\Config.php on line 510 2013-10-03T06:56:53+00:00 ERR (3): Warning: simplexml_load_string() [function.simplexml-load-string]: ^ in C:\xampp\htdocs\magento\lib\Varien\Simplexml\Config.php on line 510

The above log lines are repeated many times.

As instructed, I am trying to see my widget in :

CMS > Pages > select "home" > go to "content" tab > press "insert widget" in WYSIWYG editor.

Here is the screenshot

enter image description here

1

Without seeing a paste of your code (please add one) I would guess reading the error that there is a foreign character or more likely whitespace at the top of your XML document.

That is ultimately what the message means, you can only have the XML declaration, i.e. <?xml version="1.0"> or whatever at the start of your .xml file.

Hope this helps.

0

The XML parsing in PHP is very strict.

The piece of error from the above log is saying :

XML declaration allowed only at the start of the document

So, it is stating clearly that the xml declaration is not present at the very start of the xml file. So, I looked in my newly added xml files and found space just before the xml declaration.

When I removed that space, the newly added widgets were visible in admin panel.

Thanks to XB23 (user on IRC).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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