How to Reference Local XSD File By Relative Path

Deadly 提交于 2019-11-29 11:37:00

Think my issue was that the webapp dir may not have visibility to the resources folder.

I say this because based on the reading of the following stack overflow questions, it looks like the relative path stuff should be pretty straigh forward: XML File with local copy of XML Schema and How to use Schema that is on local machine in XML document

I then tried to brute force the references, in case it was something with deploy directory or class path, and all of the following failed:

../../../../resources/ehcache-spring-1.2.xsd
../../../resources/ehcache-spring-1.2.xsd
../../resources/ehcache-spring-1.2.xsd
../resources/ehcache-spring-1.2.xsd
./resources/ehcache-spring-1.2.xsd
../ehcache-spring-1.2.xsd
./ehcache-spring-1.2.xsd

The solution:

However by moving the xsd file from ./src/main/resources/ to ./src/main/webapp/WEB-INF/spring/ I was then able to reference it correctly/easily by just ehcache-spring-1.2.xsd

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!