5

I've received that message below when I try to reset my admin password using the Admin panel, I've my custom module installed.

I see this same message on a white screen when I try to access using the tab created in System > Configuration.

Message:

Invalid XML in file /var/www/html/rmiorder/app/code/Vendor/Hosebuilder/etc/email_templates.xml: Element 'config': Character content other than whitespace is not allowed because the content type is 'element-only'. Line: 2

Character content other than whitespace is not allowed because the content type is element-only

File XML:

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Email:etc/email_templates.xsd">
    <template id="vendor_hosebuilder_section_general_show_email_template" label="Hose email template for requesting quote" file="hose_request_email_template.html" type="html" module="Vendor_Hosebuilder" area="frontend"/>
</config>

How can I solve that issue?

18

This problem you got because the XML code, you copy directly on internet/webpage, there is some hidden character before start each line. This isn't space/ newline character. So, when push to Magento, Magento doesn't know this character, and it shows errors as your message. Solutions: clear all space between tag and order again.

  • Perfect answer solved my issue as well – PMB Jul 24 '18 at 12:01
1

Check the all and tags in the top of your module files, like theses:

etc/frontend/routes.xml

<?xml version="1.0" encoding="UTF-8"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Email:etc/email_templates.xsd">

etc/email_templates.xml

<?xml version="1.0" encoding="UTF-8"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd">

etc/module.xml

<?xml version="1.0" encoding="UTF-8"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd">

view/frontend/layout/vendor_hosebuilder_index_index.xml

<?xml version="1.0" encoding="UTF-8"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd" layout="1column">

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.