0

I was given an XML file and 20 XSD files and told to validate the XML file.

I created a small java program to load all the .xsd files into a Source array, which is then a parameter for the newSchema method of SchemaFactory (returns Schema object).
My error handler is a simple class raising SAXParseException.

When validating, I get the following:

Message: src-resolve: Cannot resolve the name 'eppcom:clIDType' to a(n) 'type definition' component.

I've found a related question: How to solve this error : src-resolve: Cannot resolve the name 'j2ee:descriptionType' to a(n) 'type definition' component.?
However, that one is about a case where it seems like just one xsd file was used, I have 20...

About 10 of my xsd files make use of the clIDType element. I believe that if I know which schema it is that is broken, I could find out what is the problem and perhaps even fix it.

The schema documents aren't very consistent. Some specify schemaLocation in the import, some don't. I tried patching up all the cases where schemaLocation is not defined for the URI importing clIDType (by adding the schemalocation) but still got the same error... Again, I think if I know at least which xsd file this is raised for, I can then try more analysis on that file until I see the problem.

Any ideas how to approach this?

DraxDomax
  • 1,008
  • 1
  • 9
  • 28
  • 1
    What makes you think that any validation is actually happening. I suspect that this error is happening during the newSchema call - when the XSDs are being loaded into a single schema model. Similarly, what makes you believe that only 1 schema is broken? Maybe all 10 schemas that use this type are broken, but newSchema() is stopping at the first error. – kimbert Jul 02 '20 at 20:59
  • good questions. As for it being just one - I didn't mean that. Just didn't want to be tedious in writing, like "the offending XML Schema (or Schemas)...". In anyway, even if it only reports the first error - that's still a result, I don't mind crawling through them until no more problems :) As for when it happens - if you are right and it happens during schema loading, this may make my investigation searchable (I could eliminate schemas from the hopper until problem is resolved and then make my conclusions) - I will debug. Thank you – DraxDomax Jul 02 '20 at 22:15
  • correct! The debugger shows the exception being raised exactly on `newSchema` call. I tried simple elimination but the XSD's are a little interdependent and just break down even more when not all loaded together :( I wonder: does the order of loading them matter? Like, if the Source[] members are arranged differently, this might have an effect? – DraxDomax Jul 03 '20 at 13:57
  • 1
    Glad you've made some progress. If you need any further technical input you will need to post a minimal reproducible example (https://stackoverflow.com/help/minimal-reproducible-example) – kimbert Jul 05 '20 at 19:10

0 Answers0