Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » XML Schema Definition (XSD) » Loading Platform Resource URI based XML Schema
Loading Platform Resource URI based XML Schema [message #598559] Fri, 18 August 2006 14:07
Stuart Stephen is currently offline Stuart StephenFriend
Messages: 22
Registered: July 2009
Junior Member

I have a standalone application and I have an XML Schema file which is
built into the jar file in the package Unfortunately when I
run this code I get a problem with regards to path mapping not being setup
correctly. I do not know how I can set this up so that it may work. Can
anybody help me?

The error and the code I am using to load the XSDResourceImpl is detailed
below. The path '/com/app/test/my.xsd' is unmapped
org.eclipse.emf.ecore.resource.impl.URIConverterImpl.createP latformResourceInputStream(Ljava/lang/String;)Ljava/io/Input Stream;(
org.eclipse.emf.ecore.resource.impl.URIConverterImpl.createI nputStream(Lorg/eclipse/emf/common/util/URI;)Ljava/io/InputS tream;(
org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Ljava/ util/Map;)V(


//Create a resource set to manage the different resources
ResourceSet resourceSet = new ResourceSetImpl();

//Register XSD resource factory

resourceSet.getResourceFactoryRegistry().getExtensionToFacto ryMap().put( "xsd",
new XSDResourceFactoryImpl());

//Create a resource for this file.
XSDResourceImpl xsdResource =
(XSDResourceImpl)resourceSet.createResource(URI.createPlatfo rmResourceURI( "com/app/test/my.xsd"));

catch (IOException e)
e.printStackTrace(); // fails here.

XSDSchema xsdSchema = xsdResource.getSchema();
Previous Topic:how to create a xml schema for ecore metamodel
Next Topic:xsd2ecore
Goto Forum:

Current Time: Sat Jan 23 02:39:20 GMT 2021

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

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

Back to the top