Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » XML Schema Definition (XSD) » Problem while serializing xsd schema
Problem while serializing xsd schema [message #68306] Fri, 09 June 2006 07:13 Go to next message
Eclipse UserFriend
Originally posted by: gjx.sdb.cnic.cn

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?
Re: Problem while serializing xsd schema [message #68318 is a reply to message #68306] Fri, 09 June 2006 11:17 Go to previous message
Eclipse UserFriend
Originally posted by: merks.ca.ibm.com

Jason,

You asked the same question in the EMF newsgroup. It's best when
posting the same question to multiple newsgroups to post a single
message to all groups at once rather than separate messages. With the
former approach, any reply on any newsgroup will appear in all
newsgroups and so creates less work for those answering the questions by
avoiding duplication...


Jason wrote:
> 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?
>
>
>
Re: Problem while serializing xsd schema [message #598181 is a reply to message #68306] Fri, 09 June 2006 11:17 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33137
Registered: July 2009
Senior Member
Jason,

You asked the same question in the EMF newsgroup. It's best when
posting the same question to multiple newsgroups to post a single
message to all groups at once rather than separate messages. With the
former approach, any reply on any newsgroup will appear in all
newsgroups and so creates less work for those answering the questions by
avoiding duplication...


Jason wrote:
> 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?
>
>
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:Problem while serializing xsd schema
Next Topic:XSD root element
Goto Forum:
  


Current Time: Fri Apr 19 13:01:28 GMT 2024

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

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

Back to the top