Community
Participate
Working Groups
Hi all, I'm programming an own xsd editor using emf´s xsd api and I faced a weird problem that I want to share/inform with u. The given situation is that I have to xsd files "A" & "B" (both define types) and B imports A. Parsing the second xsd I want walk trought the types defined only in B (A´s types have already been treated), so i proceed like this: org.eclipse.xsd.XSDSchema schema=... (B schema) Iterator<XSDTypeDefinition> itTypes = schema.getTypeDefinitions() .iterator(); while (itTypes.hasNext()) { XSDTypeDefinition type = itTypes.next(); The weird behaviour raises depending OS: Windows: type is only defined in B type Linux and Mac: type can be either A defined type or B defined type. So to make sure that I only treat B´s type I had to add the clause: Iterator<XSDTypeDefinition> itTypes = schema.getTypeDefinitions() .iterator(); while (itTypes.hasNext()) { XSDTypeDefinition type = itTypes.next(); if (type.getSchema() != xsdSchema) continue; .... Which is a little strange fixed, isnt it? Does anyone know about the reason of this problem? Best Regards, Eneko Fernández
XSDSchema.typeDefinitions should be the union of all types from all imported and included schemas, as well as from the schema itself. Likely on one OS, your imports/includes aren't resolving (because you aren't using a proper absolute URI to load the schema) so you see only the local things. In any case, you should expect to see the closure of all things.