So I have a few questions, and one way or another there seems to be a bug.  I 
have a schema where
a.xsd includes b.xsd and c.xsd
b.xsd includes c.xsd

1) c.xsd gets included twice, is this allowed?  I'm using a custom resolver and 
setting the systemId on the InputSource I return and when I do this then Xerces 
does not complain(if I don't set the systemId on the returned InputSource then 
it does complain, and I don't see the second problem)
2) The other thing I notice is the second resolution of c.xsd, the input stream 
that is passed back in the input source of the custom resolver never gets 
closed, resulting in a memory leak.  In our case because our custom resolver is 
reading XSD's embedded in our JARs it leaks some native heap resources that 
were quite difficult to track down.

Stylistically I would prefer to leave the includes the way they are because 
otherwise for some cases you would have to make the top level schema include 
other schemas just to satisfy lower level schemas that happen to be in common.

I've attached a boiled down simple test case.  To run it:
java -classpath xercesImpl.jar:leakdemo.jar xerces.test.XercesTest

The .jar file includes the source .java files.

Thanks,
Micah



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to