|
|
|
|
|
|
|
|
Re: Uniqueness not enforced by Validate [message #631255 is a reply to message #631236] |
Wed, 06 October 2010 17:11 |
Ed Merks Messages: 33216 Registered: July 2009 |
Senior Member |
|
|
This is a multi-part message in MIME format.
--------------040806050805040902020100
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Rob,
Comments below.
Rob wrote:
> Hi Ed,
>
> Thanks again for your help, however I'm a little confused. Are you
> saying that EMF does not support this case where the unique constraint
> is put on an attribute within an ComplexType that is then used as an
> element.
Yes, the mapping from XML Schema to Ecore ignores things identify
constraints, like xsd:unique.
>
> I can't see exactly what I'm doing that isn't a valid case. I was
> under the belief that the validation rule was to prevent users
> defining this case.
>
> So in the XML/XSD world someone could write a chunk of XML (Obviously
> much larger and more complicated than my little example) and then
> validate it against the schema to ensure that they hadn't broken any
> uniqueness rules.
>
> So in the EMF world, be able to define multiple objects, and then
> validate it to ensure that they again haven't broken any uniqueness
> rules.
Ecore has no corresponding concept. Certainly it enforces ID uniqueness
but not XML Schema identify constraints.
>
> I would be extremely greatful if you could elaborate, I did take a
> look at EObjectValidator.validate_UniqueID (and ran with the debugger)
> however this does nothing as the object is returning an ID of null, so
> got going into the code, so isn't actually checking it's contents. As
> I haven't editted the ecore, and just generated it from import I was
> not expecting any probelms.
Things like XML Schema complex type restrictions aren't supported
either. *All *the simple type constraints are.
>
> Thanks
>
> Rob
>
--------------040806050805040902020100
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: 8bit
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Rob,<br>
<br>
Comments below.<br>
<br>
<br>
Rob wrote:
<blockquote cite="mid:i8i784$3v4$1@news.eclipse.org" type="cite">Hi Ed,
<br>
<br>
Thanks again for your help, however I'm a little confused. Are you
saying that EMF does not support this case where the unique constraint
is put on an attribute within an ComplexType that is then used as an
element.
<br>
</blockquote>
Yes, the mapping from XML Schema to Ecore ignores things identify
constraints, like xsd:unique.<br>
<blockquote cite="mid:i8i784$3v4$1@news.eclipse.org" type="cite"><br>
I can't see exactly what I'm doing that isn't a valid case. I was
under the belief that the validation rule was to prevent users defining
this case.
<br>
<br>
So in the XML/XSD world someone could write a chunk of XML (Obviously
much larger and more complicated than my little example) and then
validate it against the schema to ensure that they hadn't broken any
uniqueness rules.
<br>
<br>
So in the EMF world, be able to define multiple objects, and then
validate it to ensure that they again haven't broken any uniqueness
rules.
<br>
</blockquote>
Ecore has no corresponding concept. Certainly it enforces ID
uniqueness but not XML Schema identify constraints.<br>
<blockquote cite="mid:i8i784$3v4$1@news.eclipse.org" type="cite"><br>
I would be extremely greatful if you could elaborate, I did take a look
at EObjectValidator.validate_UniqueID (and ran with the debugger)
however this does nothing as the object is returning an ID of null, so
got going into the code, so isn't actually checking it's contents. As
I haven't editted the ecore, and just generated it from import I was
not expecting any probelms.
<br>
</blockquote>
Things like XML Schema complex type restrictions aren't supported
either. <b>All </b>the simple type constraints are.<br>
<blockquote cite="mid:i8i784$3v4$1@news.eclipse.org" type="cite"><br>
Thanks
<br>
<br>
Rob
<br>
<br>
</blockquote>
</body>
</html>
--------------040806050805040902020100--
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Powered by
FUDForum. Page generated in 0.03920 seconds