For an XML file to validate, you have to reference a DTD or a schema file. You can identify the DTD source in your xml file, for instance, like this:

<!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN" "http://java.sun.com/dtd/ejb-jar_2_0.dtd" >

To reference a schema file, PyCharm supports standard ways, in particular, xsi attribute.

If PyCharm cannot find the specified DTD or schema, they are marked as errors. In this case special intention actions are suggested to:

  1. In the xml file, specify the URI of the DTD or schema. If the desired file is not found, the reference is marked as an error.
  2. Press Alt+Enter.
  3. In the suggestion list, select the option Manually Set Up External Resource. The Resources dialog box opens showing the new URI selected.
  4. Click edit1 (Enter).
  5. In the External Resources dialog box, specify the path to the desired DTD or schema file and click OK.
  6. Apply changes and close the Resources dialog box.

See Also

Procedures:

Reference:

Web Resources: