Hi did some googling and study of the Xerces API and did some changes:
Changed
To
Commented out the p.parse API, as I understand this obviously may not do the validation, if setValidating(false). So replaced this with:
But on running this I get the following exception (the flow now goes inside the resolveResource overidden method):
[
java] java.lang.NullPointerException
[java] at sun.misc.MetaIndex.mayContain(MetaIndex.java:225)
[java] at sun.misc.URLClassPath$JarLoader.getResource(URLClassPath.java:747)
[java] at sun.misc.URLClassPath.getResource(URLClassPath.java:169)
[java] at sun.misc.URLClassPath.getResource(URLClassPath.java:221)
[java] at java.lang.ClassLoader.getBootstrapResource(ClassLoader.java:1150)
[java] at java.lang.ClassLoader.getResource(ClassLoader.java:999)
[java] at java.lang.ClassLoader.getResource(ClassLoader.java:997)
[java] at java.lang.ClassLoader.getResourceAsStream(ClassLoader.java:1192)
[java] at java.lang.Class.getResourceAsStream(Class.java:2030)
[java] at ResourceResolver.resolveResource(Unknown Source)
[java] at org.apache.xerces.util.DOMEntityResolverWrapper.resolveEntity(Unknown Source)
[java] at org.apache.xerces.impl.XMLEntityManager.resolveEntity(Unknown Source)
This is because systemId is passed as null. I have no clue how to pass this systemId from XML. Even the publicId is null. However the nameSpaceURI shows up as:
Wonder if there is a way to make this work without using the systemId and publicId but using the nameSpaceURI, since that the only thing that gets passed to resolveResource other than the baseURI. Any help is appreciated.
Regards
Mahesh