2
1 exception(s):
Exception #0 (Magento\Framework\Config\Dom\ValidationException): Element 'head': Character content other than whitespace is not allowed because the content type is 'element-only'.
Line: 49

Element 'block', attribute 'class': [facet 'pattern'] The value '\\Magento\Framework\View\Element\Template' is not accepted by the pattern '[A-Z][a-zA-Z\d]*(\\[A-Z][a-zA-Z\d]*)*'.
Line: 735

Element 'block', attribute 'class': '\\Magento\Framework\View\Element\Template' is not a valid value of the atomic type 'blockClassType'.
Line: 735

Element 'remove', attribute 'src_type': The attribute 'src_type' is not allowed.
Line: 778

Element 'block', attribute 'remove': The attribute 'remove' is not allowed.
Line: 824

Element 'block', attribute 'class': [facet 'pattern'] The value '\\Magento\Framework\View\Element\Template' is not accepted by the pattern '[A-Z][a-zA-Z\d]*(\\[A-Z][a-zA-Z\d]*)*'.
Line: 838

Element 'block', attribute 'class': '\\Magento\Framework\View\Element\Template' is not a valid value of the atomic type 'blockClassType'.
Line: 838

Element 'move', attribute 'name': The attribute 'name' is not allowed.
Line: 890

Element 'move', attribute 'name': The attribute 'name' is not allowed.
Line: 891

Element 'remove': This element is not expected. Expected is one of ( block, container, referenceBlock, referenceContainer, uiComponent ).
Line: 909

Element 'move': This element is not expected. Expected is one of ( action, arguments, block, container, referenceBlock, uiComponent ).
Line: 1293

Element 'move', attribute 'name': The attribute 'name' is not allowed.
Line: 1317

Element 'move', attribute 'name': The attribute 'name' is not allowed.
Line: 1318

4 Answers 4

3

About: [facet 'pattern']

Element 'block', attribute 'class': [facet 'pattern'] The value '\Magento\Framework\View\Element\Template' is not accepted by the pattern '[A-Z][a-zA-Z\d](\[A-Z][a-zA-Z\d])*'.

This file contain the pattern: /vendor/magento/framework/View/Layout/etc/elements.xsd:133 '[a-zA-Z][a-zA-Z\d\-_]*(\s[a-zA-Z][a-zA-Z\d\-_]*)*'

Probably you have double spaces in somewhere, just remove it. You can use this link https://regex101.com/ to teste your css classes added on container or block

About: The attribute 'src_type'

Element 'remove', attribute 'src_type': The attribute 'src_type' is not allowed.

According with Magento DevDocs just use remove attribute on reference block or container. So is unnecessary the attribute src_type.

Read the documentation: Magento DevDocs - Remove elements

Example:

<referenceBlock name="catalog.compare.sidebar" remove="true" />

About Rearrange elements

Element 'move', attribute 'name': The attribute 'name' is not allowed.

Read the documentation: Magento DevDocs - Rearrange elements

name is not part of attributes of <move> element. Check the structure: <move element="" destination="" after=""/>

2

This is a known issue that many faces when upgrading from 2.1.8 to 2.2.0.

The validation of templates didn't work before. Now it works and all module and layout updates needs to follow the validation rules.

See those threads:
https://github.com/magento/magento2/issues/11194 https://github.com/magento/magento2/issues/11116

Do you happen to use Fooman analytics module? If so, their proposal is to update to a later version. Read more here: http://magento2-support.fooman.co.nz/article/1562-xsd-template-validation-error?

4
  • I got above error when change mode From Production to Developer.
    – Bhavesh
    Nov 15, 2017 at 6:31
  • Do you use Fooman analytics module? Nov 15, 2017 at 12:33
  • No, I am use Fooman PrintOrderPdf, I already disable it. But still get same error.
    – Bhavesh
    Nov 16, 2017 at 6:10
  • Fooman is likely only part of the issue. But, have you tried to update it according to their request? It should remove some of the errors. Nov 16, 2017 at 11:10
0

this exception occurs because you are using an invalid attribute for the element, for example:

Example 1:

<move name = "form.subscribe"/> 

Error: the name attribute is not allowed in the move element

Solution: remove the attribute 'name' if use into move element

Example 2:

<remove name="form.subscribe"/> 

Error: the remove attribute is not valid

Solution:

<referenceBlock name="form.subscribe" remove="true" />

See the list of allowed attributes in: https://devdocs.magento.com/guides/v2.2/frontend-dev-guide/layouts/xml-instructions.html#fedg_layout_xml-instruc_ex_rem

-2

I had the same issue.

If you can still access the webadmin Go into the admin and look for those block IDs. Copy those blocks names and contents into their own text file.

Then, delete those blocks from the admin. If you can't access via admin, you can copy and delete them via phpmyadmin or other database method.

Then run these commands in order

php bin/magento setup:upgrade

php bin/magento cache:flush

php bin/magento indexer:reindex

php bin/magento deploy:mode:set production -s

php bin/magento setup:di:compile

php bin/magento setup:static-content:deploy -s standard

I was then able to complete the update to 2.2.1 and then just added the blocks I needed back into the store.

The blocks causing the issue for me were calling product lists via widgets, hope it works for you.

4
  • I got above error when change mode From Production to Developer.
    – Bhavesh
    Nov 15, 2017 at 6:31
  • @Bhavesh did you resolve the issue? I am also facing the same issue when tried changing mode from production to developer Jun 15, 2018 at 10:00
  • @KalyanChakravarthiV, In my case issue with theme (venustheme) after upgrade theme it solved.
    – Bhavesh
    Jun 18, 2018 at 5:26
  • I too got the solution, in theme xml remove attribute is there for the block, that caused the exception Jun 18, 2018 at 5:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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