Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » ServerTools (WTP) » Validation error on schemalocation of Eclipse-generated xsd file.
Validation error on schemalocation of Eclipse-generated xsd file. [message #204746] Tue, 20 November 2007 14:30 Go to next message
Juan Pedro Silva is currently offline Juan Pedro SilvaFriend
Messages: 258
Registered: July 2009
Senior Member
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
</head>
<body bgcolor="#ffffff" text="#000000">
Hi everybody. <br>
I've asked this in the EMF newsgroup and I was told this newsgroup was
more appropriate.<br>
I'm generating some xsd, wsdl, etc., for my project, and suddenly came
upon this problem.<br>
<br>
While generating an schema <b>with the eclipse wizard</b>, I get:<br>
<br>
&lt;xsd:import namespace=<a class="moz-txt-link-rfc2396E"
href="http://www.eclipse.org/emf/2002/Ecore">"http://www.eclipse.org/emf/2002/Ecore"</a>
schemaLocation=" ../../../../../../../plugin/org.eclipse.emf.ecore/model/Ecor e.xsd "/&gt;<br>
<br>
I guess "../../../../../../../" represents the path to the eclipse
installation folder (there are just as much "../" segments as
directories before my eclipse installation folder), but when trying to
validate the xsd I get "Failed
to read schema document" for that line, and therefore all files
that reference this schema are not valid. I placed Ecore.xsd in the
same folder and shortened the path to "./" and validation worked fine.
<br>
<br>
Is the path expression invalid?, which is the maximum allowed depth for
it to be valid?. Relative paths are supposed to be valid, although I
understand this one is not among the most elegant ones.<br>
I'm a newcomer to schemas, so I'm a little lost here. I would very much
appreciate your help.<br>
Thank you in advance.<br>
Regards,<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Juan Pedro<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;
</body>
</html>
Re: Validation error on schemalocation of Eclipse-generated xsd file. [message #204751 is a reply to message #204746] Tue, 20 November 2007 15:28 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: dcarver.starstandard.org

>
> While generating an schema *with the eclipse wizard*, I get:
>
> <xsd:import namespace="http://www.eclipse.org/emf/2002/Ecore"
> schemaLocation=" ../../../../../../../plugin/org.eclipse.emf.ecore/model/Ecor e.xsd "/>
>
> I guess "../../../../../../../" represents the path to the eclipse
> installation folder (there are just as much "../" segments as
> directories before my eclipse installation folder), but when trying to
> validate the xsd I get "Failed to read schema document" for that line,
> and therefore all files that reference this schema are not valid. I
> placed Ecore.xsd in the same folder and shortened the path to "./" and
> validation worked fine.
>
> Is the path expression invalid?, which is the maximum allowed depth for
> it to be valid?. Relative paths are supposed to be valid, although I
> understand this one is not among the most elegant ones.
> I'm a newcomer to schemas, so I'm a little lost here. I would very much
> appreciate your help.

Yes, you can use relative paths. What that relative path is saying, is
go back up 7 directories, and then go into the plugin/
org.eclipse.emf.ecore/
model/

and then load the Ecore.xsd.

If the relative path is generated wrong, or if the relative path
generated points to a file that is referenced and not actually in your
workspace, then it won't be able to find the schema specified.

Particularly if the project is a referenced project and not actually
residing in the same workspace, you will have problems. Not sure if
that is what is happening here or not though.
Re: Validation error on schemalocation of Eclipse-generated xsd file. [message #204759 is a reply to message #204751] Tue, 20 November 2007 15:57 Go to previous messageGo to next message
Juan Pedro Silva is currently offline Juan Pedro SilvaFriend
Messages: 258
Registered: July 2009
Senior Member
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
David, after giving you an elaborated answer, I just noticed:<br>
<br>
schemaLocation="../../../../../../../<font color="#ff0000"><b>plugin</b></font>/org.eclipse.emf.ecore/model/Ecore.xsd "<br>
<br>
instead of "plugins", which is the correct folder. It's odd somehow, as
the schema was generated by the EMF Exporter wizard, not by me.<br>
I placed the jar file in a new "plugin" folder, and everything is
working fine now.<br>
<br>
I will re-post to EMF newsgroup and see if this is a bug or what.<br>
Thank you,<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Juan Pedro<br>
<br>
David Carver escribi&oacute;:
<blockquote cite="mid:fhuuen$ql7$1@build.eclipse.org" type="cite">
<blockquote type="cite"><br>
While generating an schema *with the eclipse wizard*, I get:
<br>
<br>
&lt;xsd:import namespace=<a class="moz-txt-link-rfc2396E" href="http://www.eclipse.org/emf/2002/Ecore">"http://www.eclipse.org/emf/2002/Ecore"</a>
schemaLocation=" ../../../../../../../plugin/org.eclipse.emf.ecore/model/Ecor e.xsd "/&gt;
<br>
<br>
I guess "../../../../../../../" represents the path to the eclipse
installation folder (there are just as much "../" segments as
directories before my eclipse installation folder), but when trying to
validate the xsd I get "Failed to read schema document" for that line,
and therefore all files that reference this schema are not valid. I
placed Ecore.xsd in the same folder and shortened the path to "./" and
validation worked fine.
<br>
<br>
Is the path expression invalid?, which is the maximum allowed depth for
it to be valid?. Relative paths are supposed to be valid, although I
understand this one is not among the most elegant ones.
<br>
I'm a newcomer to schemas, so I'm a little lost here. I would very much
appreciate your help.
<br>
</blockquote>
<br>
Yes, you can use relative paths. What that relative path is saying, is
go back up 7 directories, and then go into the plugin/
<br>
org.eclipse.emf.ecore/
<br>
model/
<br>
<br>
and then load the Ecore.xsd.
<br>
<br>
If the relative path is generated wrong, or if the relative path
generated points to a file that is referenced and not actually in your
workspace, then it won't be able to find the schema specified.
<br>
<br>
Particularly if the project is a referenced project and not actually
residing in the same workspace, you will have problems.&nbsp; Not sure if
that is what is happening here or not though.
<br>
</blockquote>
</body>
</html>
Re: Validation error on schemalocation of Eclipse-generated xsd file. [message #204809 is a reply to message #204759] Wed, 21 November 2007 16:51 Go to previous messageGo to next message
Juan Pedro Silva is currently offline Juan Pedro SilvaFriend
Messages: 258
Registered: July 2009
Senior Member
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
David, my last response was a miss-interpretation of the structure of
the generated path.<br>
As pointed out by Ed Merks in <a
href="news://news.eclipse.org:119/fi1l7f$rfe$1@build.eclipse.org">this</a>
post, this path is using the "plugin" symbolic URI (like
platform:/plugin/ and
platform:/resource).<br>
This path is correctly resolved by the "Sample XML Schema Editor" (the
one provided by XSD), it
doesn't complain about unresolved imports and on the Semantics tab you
can see that the imports from Ecore.xsd are present.<br>
<br>
If I change the schemalocation value to "<font color="#33ccff">platform:/plugin/org.eclipse.emf.ecore/model/Ecore.xsd "
<font color="#000000">instead of</font> "../../../../../../../</font><font
color="#33ccff">plugin/org.eclipse.emf.ecore/model/Ecore.xsd " <font
color="#000000">the schema file is reported as valid. <br>
They point out in the EMF newsgroup that both paths should be correctly
resolved.<br>
<br>
They also find odd that a URI in the form "</font></font><a
moz-do-not-send="true" class="moz-txt-link-freetext"
href=" file:///J:/Programas/Eclipse_Para_RSA/eclipse/ws_Europa/juan .pedro/WSDL_Output/PruebaProfSegm/WSDL_Output/Schemas/BlankM odel.xsd">file:///</a>"
is used to resolve the relative paths, as they will generally cause
problems for relative paths that span projects in
the workspace (because each project could be in a different location
rather than be physically nested in the workspace) and will not work at
all for resources backed by other EFS implementations.&nbsp; They tell me
that perhaps I
should open a bugzilla against this issue.<br>
<br>
I must clarify that I'm using WTP 1.5.5, and so perhaps the things I'm
mentioning have already changed.<br>
I hold for your comments.<br>
Regards,<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; Juan Pedro<br>
<font color="#33ccff"><font color="#000000"><br>
</font></font><br>
<br>
Juan Pedro Silva escribi&oacute;:
<blockquote cite="mid:fhv0a4$7f0$1@build.eclipse.org" type="cite">
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
David, after giving you an elaborated answer, I just noticed:<br>
<br>
schemaLocation="../../../../../../../<font color="#ff0000"><b>plugin</b></font>/org.eclipse.emf.ecore/model/Ecore.xsd "<br>
<br>
instead of "plugins", which is the correct folder. It's odd somehow, as
the schema was generated by the EMF Exporter wizard, not by me.<br>
I placed the jar file in a new "plugin" folder, and everything is
working fine now.<br>
<br>
I will re-post to EMF newsgroup and see if this is a bug or what.<br>
Thank you,<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Juan Pedro<br>
<br>
David Carver escribi&oacute;:
<blockquote cite="mid:fhuuen$ql7$1@build.eclipse.org" type="cite">
<blockquote type="cite"><br>
While generating an schema *with the eclipse wizard*, I get: <br>
<br>
&lt;xsd:import namespace=<a moz-do-not-send="true"
class="moz-txt-link-rfc2396E"
href="http://www.eclipse.org/emf/2002/Ecore">"http://www.eclipse.org/emf/2002/Ecore"</a>
schemaLocation=" ../../../../../../../plugin/org.eclipse.emf.ecore/model/Ecor e.xsd "/&gt;
<br>
<br>
I guess "../../../../../../../" represents the path to the eclipse
installation folder (there are just as much "../" segments as
directories before my eclipse installation folder), but when trying to
validate the xsd I get "Failed to read schema document" for that line,
and therefore all files that reference this schema are not valid. I
placed Ecore.xsd in the same folder and shortened the path to "./" and
validation worked fine. <br>
<br>
Is the path expression invalid?, which is the maximum allowed depth for
it to be valid?. Relative paths are supposed to be valid, although I
understand this one is not among the most elegant ones. <br>
I'm a newcomer to schemas, so I'm a little lost here. I would very much
appreciate your help. <br>
</blockquote>
<br>
Yes, you can use relative paths. What that relative path is saying, is
go back up 7 directories, and then go into the plugin/ <br>
org.eclipse.emf.ecore/ <br>
model/ <br>
<br>
and then load the Ecore.xsd. <br>
<br>
If the relative path is generated wrong, or if the relative path
generated points to a file that is referenced and not actually in your
workspace, then it won't be able to find the schema specified. <br>
<br>
Particularly if the project is a referenced project and not actually
residing in the same workspace, you will have problems.&nbsp; Not sure if
that is what is happening here or not though. <br>
</blockquote>
</blockquote>
</body>
</html>
Re: Validation error on schemalocation of Eclipse-generated xsd file. [message #204817 is a reply to message #204809] Wed, 21 November 2007 17:21 Go to previous message
Eclipse UserFriend
Originally posted by: dcarver.starstandard.org

You might want to add your comments to the following bug:

https://bugs.eclipse.org/bugs/show_bug.cgi?id=196353

It describes a similar situation as you found. One of the issues I
think is that the validator used is expecting a file url to be passed to
it. So that is why the long relative path is included. However, you
said, if that relative path isn't in the same workspace, it won't find
the file. This happens a lot with referenced projects, and I ran into
it myself. So any additional comments and feedback to bug 196353 would
help.

Dave

Juan Pedro Silva wrote:
> David, my last response was a miss-interpretation of the structure of
> the generated path.
> As pointed out by Ed Merks in this
> <news://news.eclipse.org:119/fi1l7f$rfe$1@build.eclipse.org> post, this
> path is using the "plugin" symbolic URI (like platform:/plugin/ and
> platform:/resource).
> This path is correctly resolved by the "Sample XML Schema Editor" (the
> one provided by XSD), it doesn't complain about unresolved imports and
> on the Semantics tab you can see that the imports from Ecore.xsd are
> present.
>
> If I change the schemalocation value to
> "platform:/plugin/org.eclipse.emf.ecore/model/Ecore.xsd" instead of
> " ../../../../../../../plugin/org.eclipse.emf.ecore/model/Ecor e.xsd " the
> schema file is reported as valid.
> They point out in the EMF newsgroup that both paths should be correctly
> resolved.
>
> They also find odd that a URI in the form "file:///" is used to resolve
> the relative paths, as they will generally cause problems for relative
> paths that span projects in the workspace (because each project could be
> in a different location rather than be physically nested in the
> workspace) and will not work at all for resources backed by other EFS
> implementations. They tell me that perhaps I should open a bugzilla
> against this issue.
>
> I must clarify that I'm using WTP 1.5.5, and so perhaps the things I'm
> mentioning have already changed.
> I hold for your comments.
Previous Topic:Line delimiters
Next Topic:Remote Java Application gone?
Goto Forum:
  


Current Time: Thu Apr 25 00:58:29 GMT 2024

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

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

Back to the top