Domanda

Looking through Magento 2 di.xml files there are various types of xsi:noNamespaceSchemaLocation

When should we be using each schema?

È stato utile?

Soluzione

It depends on the type of XML file you create.

Basically, all the XSD files can be found under the lib/internal/Magento/Framework folder, here is the list on 2.1.2:

enter image description here

For example, if you create a etc/acl.xml in your module, you'll have to use the acl.xsd file.

There are a few details about it in the official documentation:

My personal practice is: when I want to create an XML file, I check the same type of file in the core and get the URN schema from it.

Also, you can create your own XSD in case you want to use a custom type of XML: How can we write an XSD file in Magento 2?

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a magento.stackexchange
scroll top