XSD resolution

Added the following to an XML file...

<?xml version="1.0" encoding="UTF-8" ?>
<mule xmlns="http://www.mulesource.org/schema/mule/core/3.0"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="
        http://www.mulesource.org/schema/mule/core/3.0
        http://www.mulesource.org/schema/mule/core/3.0/mule.xsd">

</mule>

I expected Intellij to resolve the mule.xsd file and enable code completion and error checking. Unfortunately, it did not unless I saved the XSD to a local file and registered the URI in the Resources. I was sort of hoping IDEA would handle that automatically when the XSD is public and accessible over http. Mule has a lot of schemas and I'd prefer to have Intellij register them automatically. Is it necessary to map the URI to a local XSD file even when the XSD is available over http?

2 comments

I thought I had it working after adding the mule jar files to my project classpath but it did not work. I still get errors and no code completion for the schema until I register the URI. My updated XML is below. My initial markup had some errors for Mule 3.0 that I fixed but I still can't get the XSD resolution without registering the XSD in the jar.

<?xml version="1.0" encoding="UTF-8" ?>
<mule xmlns="http://www.mulesoft.org/schema/mule/core"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns:stdio="http://www.mulesoft.org/schema/mule/stdio"
      xsi:schemaLocation="
        http://www.mulesoft.org/schema/mule/core
        http://www.mulesoft.org/schema/mule/core/3.0/mule.xsd
        http://www.mulesoft.org/schema/mule/stdio
        http://www.mulesoft.org/schema/mule/stdio/3.0/mule-stdio.xsd">

</mule>

0

Another convenient way is to choose "Fetch external resource" quick fix.

0

Please sign in to leave a comment.