Magento 2
XML Schema Resolution
Free Preview
🟢 Good code
<!--
Specifying a Uniform Resource Name (URN) for an XML schema location is Magento's
preferred implementation method. This decouples hard-coded XML schema locations
by replacing them with dynamic addresses which can be changed at a later date.

Module - urn:magento:module:Foo_Bar:{relative_path}
Magento Framework - urn:magento:framework:Module/{relative_path}

Run `bin/magento dev:urn-catalog:generate` to generate URNs for your IDE.
-->
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xml:noNamespaceSchemaLocation="urn:magento:framework:Acl/etc/acl.xsd">
    <acl>
        <resources>
            ...
🔴 Bad code
<!--
Specifying a relative path for an XML schema location is not recommended.
The location of the Magento Framework should not be pre-determined, as this
location can change over time (for example, local vs. Composer installation).
-->
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xml:noNamespaceSchemaLocation="../../lib/Magento/Framework/Acl/etc/acl.xsd">
    <acl>
        <resources>
            ...
Want to learn more?

Visit M.academy to learn much more about Magento, Laravel, PHP, Javascript, & Docker.

M.academy logo