1

Tried to install a store locator extension.

When go to the front end producing this error.

1 exception(s): Exception #0 (Magento\Framework\Config\Dom\ValidationException): Element 'block': This element is not expected. Expected is one of ( title, css, link, meta, script, remove, attribute ). Line: 708

Exception #0 (Magento\Framework\Config\Dom\ValidationException): Element 'block': This element is not expected. Expected is one of ( title, css, link, meta, script, remove, attribute ). Line: 708

0 D:\xampp\htdocs\tork\vendor\magento\framework\Config\Dom.php(115): Magento\Framework\Config\Dom->_initDom(' 1D:\xampp\htdocs\tork\vendor\magento\framework\ObjectManager\Factory\AbstractFactory.php(111): Magento\Framework\Config\Dom->__construct('

How can i fix this issue?. Magento version 2.2.2

asked Mar 26, 2018 at 11:40

1 Answer 1

2

most probably you have in one of your layout files a <block> tag inside the <head> tag.
The <head> tag does not support block child elements.
See the xsd validation schema for head section: https://github.com/magento/magento2/blob/2.2-develop/lib/internal/Magento/Framework/View/Layout/etc/head.xsd#L51

If your next question is, "But I need to add a block to my head section. how do I do that?" then you can check this: Magento 2: Adding Arbitrary HTML to the <head> of Every Page?

answered Mar 26, 2018 at 11:50
2
  • 1
    Oh yeah....or the other way around. Didn't think this could be :) Commented Mar 26, 2018 at 12:33
  • Element 'route': Missing child element(s). Expected is ( resources ). any help? Commented Sep 24, 2020 at 11:06

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.