title: XML - relative path to XSD
body: <p>I have simple Spring project splitted in three modules, like:</p>
  
  <ul>
  <li>module1
  
  <ul>
  <li>src/main/java/com/test/Module1Test.xml</li>
  </ul></li>
  <li>module2
  
  <ul>
  <li>src/main/java/com/test/Module2Test.xml</li>
  <li>src/main/java/com/test/Modules.xsd</li>
  </ul></li>
  <li>module3
  
  <ul>
  <li>src/main/java/com/test/Module3Test.xml</li>
  </ul></li>
  </ul>
  
  <p>Like you can see in module2 I have create XSD file to validate XML files in all three modules.
  To validate XML file with XSD in module2, I simply added following line:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8" standalone="no"?&gt;
  &lt;Module2Test xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="Modules.xsd"&gt;
  </code></pre>
  
  <p>However I have no idea how I can validate <code>Module1Test.xml</code> and <code>Module3Test.xml</code> files with my XSD. I cannot use absolute path to my XSD in XML files like:</p>
  
  <pre><code>&lt;Module2Test xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="file:///C:\\project\\module2\\src\\main\\java\\com\\test\\Modules.xsd"&gt;
  </code></pre>
  
  <p>and I would like to use relative path, something like:</p>
  
  <pre><code>&lt;Module2Test xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="project\\module2\\src\\main\\java\\com\\test\\Modules.xsd"&gt;
  </code></pre>
  
  <p>Or in other better way, just to not use <strong>absolute</strong> path. </p>
  
  <p>Do you know if it's possible? How can I solve it?</p>