hello experts,
I am validating XML messages in XI using a Java mapping and by loading the XSDs at runtime.
I am facing a typical problem when my XSDs import / include other XSDs and below is the situation.
-
I have a Java mapping class say Validator in a package
com.myclient.xiutils.
I have XSDs in a folder inside this package which is
com.myclient.xiutils.xsds
Within the Validator class, I load the XSDs using the statement,
InputStream schemaInputStream =
this.getClass().getResourceAsStream("xsds/primary.xsd");
There is no issue if the primary.xsd has everything inside it but in my case, the third party has provided the xsds to us and the primary.xsd has a reference (import) to secondary.xsd.
whichever location in the package structure I put the secondary.xsd, XI does not recognize it and errors out saying unable to find secondary.
The workaround I had used was I copied the secondary.xsd to the location pointed by the environment variable user.dir and XI could find it at runtime but I want to know what is the correct way.
Edited by: Amol Joshi on May 28, 2008 10:53 AM