If you want your PhpStorm IDE to provide Magento2 xml validation on the fly, you now need to set up a misc.xml file in your .idea folder. In your misc.xml file you can configure how the URLs are mapped to the file locations of the Magento2 XSD files. Take the following xml as example:

<config xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance” xsi:noNamespaceSchemaLocation=”urn:magento:framework:Module/etc/module.xsd”>

The URL is “urn:magento:framework:Module/etc/module.xsd”. The place where PhpStorm is looking for a mapping to any file is the misc.xml file. Since you have not created one, or not inserted the mappings, it will not find the XSDs and on the fly validation won’t work.

Magento2 xml validation

There are different ways to let your IDE validate Magento2 XML files on the fly. If you have not installed the Magento2 PhpStorm Plugin already, I would recommend to use the bin/magento command line tool.

Continue reading