PHP 7.3 reached end of support in December 2021 and Adobe Commerce 2.3.x reaches end of support in September 2022. You may want to consider planning your upgrade now to Adobe Commerce 2.4.x and PHP 7.4.x to help maintain PCI compliance.

URN schema validation

Each Magento module can contain XSD files for XML validation.

Magento uses Uniform Resource Names (URNs) to reference XML schema declarations.

Magento supported URNs begin with urn:magento. Magento supports two XSD reference types:

  • Module XSD
  • Framework XSD

You cannot change the XSD for any XML files provided with the Magento application.

Module XSD

The syntax for the module XSD is a colon separated declaration. An example follows:



  • urn:magento is the URN identifier
  • module is the reference type identifier
  • Magento_Flow is the name of the module. This must be exactly the same as the module specified by ComponentRegistrar in the registration.php file.
  • flows/content.xsd is the relative path to the module’s directory.

Framework XSD

The syntax for the framework XSD is a colon separated declaration. An example follows:



  • urn:magento is the URN identifier
  • framework is the reference type identifier. You can also add additional framework libraries as separate components with framework-<sub-name>
  • Api/etc/extension_attributes.xsd is the relative path to the framework’s directory.

Referencing a XSD from another XSD

Use URN notation to reference schema from inside a XSD document:

<xs:redefine schemaLocation="urn:magento:framework:Config/etc/view.xsd">

The URN resolution is invoked automatically by the libxml engine. Register the URN resolver by using libxml_set_external_entity_loader:

libxml_set_external_entity_loader(['Magento\Framework\Config\Dom\UrnResolver', 'registerEntityLoader']);

The relative path to other XSDs cannot be used from inside the XSD file, because the entity loader fails to resolve the relative path.

Next step

Name your component