Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » XSD » The location has not been resolved because the import is unused
The location has not been resolved because the import is unused [message #967577] Thu, 01 November 2012 21:47
Christer Palm is currently offline Christer PalmFriend
Messages: 5
Registered: November 2012
Junior Member
I'm trying to use org.eclipse.xsd 2.8.0 (in Eclipse Juno) to parse XBRL taxonomy schemas.

To quote the official description of the XBRL Global Ledger Framework; "The structure of the taxonomies is such that a complete taxonomy is "compiled" by assembling a set of schemas via a "palette" schema".
Basically, this means that there's a set of .xsd files glued together with import's.

Unfortunately I'm stuck at the fundamental task of getting XSD to automatically resolve the imports at load time, using boilerplate example code. XSD only loads the top-level schema document and the diagnostics for that XSDSchema reveals that the imported schemas doesn't get resolved because the imports are not used:

  Line 4 Column 4: warning: XSD: The location 'gl-cor-content-2006-10-25.xsd' has not been resolved because the import is unused
  Line 4 Column 4: warning: XSD: There is no xmlns declaration for namespace '[Redacted because this stupid forum thinks I'm trying to spam the forum with an off site link]'

How can I force XSD to resolve the imports?


The code I'm using:
		ResourceSet tResourceSet = XSDSchemaImpl.createResourceSet();
		Registry tRegistry = tResourceSet.getResourceFactoryRegistry();
		Map<String, Object> tFactoryMap = tRegistry.getExtensionToFactoryMap();
		tFactoryMap.put("xsd", new XSDResourceFactoryImpl());

		Map<Object, Object> tLoadOptions = tResourceSet.getLoadOptions();
		tLoadOptions.put(XSDResourceImpl.XSD_TRACK_LOCATION, Boolean.TRUE);
		String tFile = "/tmp/gl/2006-10-25/plt/case-c/gl-plt-2006-10-25.xsd";
		URI tUri = URI.createFileURI(tFile);
		Resource tResource = tResourceSet.getResource(tUri, true);

		System.out.println("Resources loaded in set: " + tResourceSet.getResources().size());

The XBRL GL schemas are available here:
h t t p : / /
Previous Topic:XSD with IDREF -> ecore
Next Topic:HOW TO: breaking XSD file into multiple XSD files
Goto Forum:

Current Time: Wed Feb 26 11:45:28 GMT 2020

Powered by FUDForum. Page generated in 0.04499 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top