Problem while serializing xsd schema [message #598171] |
Fri, 09 June 2006 07:13 |
Jason Messages: 45 Registered: July 2009 |
Member |
|
|
Hi all
I want to construct a schema and save it
My code like this:
saveFile.addSelectionListener(new SelectionListener()
{
public void widgetSelected(SelectionEvent e)
{
FileDialog fd = new FileDialog(getShell(), SWT.SAVE);
String filename = fd.open();
if (filename == null)
return;
URI fileURI = URI.createPlatformResourceURI(filename);
ResourceSet resourceSet = new ResourceSetImpl();
Resource resource = resourceSet.createResource(fileURI);
resource.getContents().add(newSchema);
try
{
resource.save(Collections.EMPTY_MAP);
}
catch (Exception ex)
{
ex.printStackTrace();
}
}
});
but when I run the application, I get the following error message:
java.io.IOException: The path '/xxx/xxx.xsd' is unmapped
at
org.eclipse.emf.ecore.resource.impl.URIConverterImpl.createP latformResourceO
utputStream(URIConverterImpl.java:376)
at
org.eclipse.emf.ecore.resource.impl.URIConverterImpl.createO utputStream(URIC
onverterImpl.java:306)
at DropTargetTree$5.widgetSelected(DropTargetTree.java:193)
what's the problem?
|
|
|
Powered by
FUDForum. Page generated in 0.02840 seconds