How to Solve the Message ‘Character Content Other Than Whitespace’ in Magento 2

adminemailmagento2module

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?

Best Answer

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.

Related Topic