Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » XML Schema Definition (XSD) » Analysis of XML Schema specific annotations, properties in Resource Impl.
Analysis of XML Schema specific annotations, properties in Resource Impl. [message #68174] Fri, 19 May 2006 06:29 Go to next message
Eclipse User
Originally posted by: mathiasfrz.web.de

Hi,
I tried the serialization of XML Schema based (annotated) Ecore models.
I tried this using the XMLResource.OPTION_EXTENDED_META_DATA option (and
all other generated options) in the generated RessourceFactory.
The result was an xml instance of the Schema which differentiates between
attributes and elements as specified in the schema (example: nested
elements specified in the schema are serialized as nested elements in the
XML instance of the schema).
After commenting out of XMLResource.OPTION_EXTENDED_META_DATA (and all the
other options) all nested elements specified in the schema were serialized
as attributes in a resulting xml instance of the schema.
On the other hand, I found no checks of xml schema defined restrictions
(like "minOccurs", "maxOccurs", "xmlns" for any) for the serialization of
instances of the XMLSchema. Did I something wrong?
... Or results the option OPTION_EXTENDED_META_DATA only in analysis of
the Annotation "kind" of the Ecore model ... and nothing more?

Thank you very much! (And thank you for your last very fast (and helpful)
answer!!!)

Mathias
Re: Analysis of XML Schema specific annotations, properties in Resource Impl. [message #68185 is a reply to message #68174] Fri, 19 May 2006 07:57 Go to previous messageGo to next message
Eclipse User
Originally posted by: merks.ca.ibm.com

This is a multi-part message in MIME format.
--------------040608070808040600060002
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit

Mathias,

The constraints, if any, are generated as part of the validator.

The EMF Validation Framework Overview
< http://www.eclipse.org/emf/docs.php?doc=references/overview/ EMF.Validation.html>

EObjectValidator does all the constraint checking for a dynamic model
and for generated models there will be a generated validator, if there
are constraints in the model. Constraints such as min/maxOccurs simply
map to multiplicities of the features and can those are checked by the
reflective EObjectValidator. Constraints such as facet constraints on
simple types will result in a generated validator. In general, you can
use Diagnostician.INSTANCE.validate(EObject) to check all the
constraints; that's effectively what right clicking and running
"Validate" in the generated editor will do.


Mathias wrote:
> Hi,
> I tried the serialization of XML Schema based (annotated) Ecore
> models. I tried this using the XMLResource.OPTION_EXTENDED_META_DATA
> option (and all other generated options) in the generated
> RessourceFactory. The result was an xml instance of the Schema which
> differentiates between attributes and elements as specified in the
> schema (example: nested elements specified in the schema are
> serialized as nested elements in the XML instance of the schema).
> After commenting out of XMLResource.OPTION_EXTENDED_META_DATA (and all
> the other options) all nested elements specified in the schema were
> serialized as attributes in a resulting xml instance of the schema. On
> the other hand, I found no checks of xml schema defined restrictions
> (like "minOccurs", "maxOccurs", "xmlns" for any) for the serialization
> of instances of the XMLSchema. Did I something wrong?
> .. Or results the option OPTION_EXTENDED_META_DATA only in analysis of
> the Annotation "kind" of the Ecore model ... and nothing more?
> Thank you very much! (And thank you for your last very fast (and
> helpful) answer!!!)
>
> Mathias
>
>


--------------040608070808040600060002
Content-Type: text/html; charset=ISO-8859-15
Content-Transfer-Encoding: 8bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-15"
http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Mathias,<br>
<br>
The constraints, if any, are generated as part of the validator. <br>
<blockquote><a
href=" http://www.eclipse.org/emf/docs.php?doc=references/overview/ EMF.Validation.html">
Re: Analysis of XML Schema specific annotations, properties in Resource Impl. [message #68197 is a reply to message #68185] Fri, 19 May 2006 08:38 Go to previous messageGo to next message
Eclipse User
Originally posted by: mathiasfrz.web.de

Thank you for the quick answer! Now the verification of my constraints
works!

For understanding (and for my master thesis :-))

What you mean is that the resource implementation only uses the annotated
kind (element, attribute,..) of the ecore model elements for serializing
XML Schema instances (XML Documents).
This means, that the option OPTION_EXTENDED_META_DATA only results in an
analysis of the ExtendedMetaData.kind of the EObjects.
For checking other XML Schema specific details (such as min/maxOccurs,
wildcards) the Validator is used. Is this correct?

Thank you again,

Mathias
Re: Analysis of XML Schema specific annotations, properties in Resource Impl. [message #68208 is a reply to message #68197] Fri, 19 May 2006 08:50 Go to previous messageGo to next message
Eclipse User
Originally posted by: mathiasfrz.web.de

(better formulation of my question)

Hi Ed Merks,

Thank you for the quick answer! Now the verification of my constraints
works!

For understanding (and for my master thesis :-))

What you mean is that the resource implementation only uses the annotated
kind (element, attribute,..) of the ecore model elements for serializing
XML Schema instances (XML Documents). This means, that the option
OPTION_EXTENDED_META_DATA only results in an analysis of the
ExtendedMetaData.kind of the EObjects. Other XML Schema specific details
(such as min/maxOccurs, wildcards) have no influence to the serialization
(resource implementation), but to the Validator. Is this correct?

Thank you again,

Mathias
Re: Analysis of XML Schema specific annotations, properties in Resource Impl. [message #68219 is a reply to message #68208] Fri, 19 May 2006 09:02 Go to previous messageGo to next message
Eclipse User
Originally posted by: merks.ca.ibm.com

Mathias,

The annotation information comes into play in other places as well. For
example, an element wildcard's feature will only allow features that
correspond to global elements in its contents (and it enforces the
namespace constraint on the namespace of those elements as well). The
OPTION_EXTENDED_META_DATA is used merely to instruct the serializer that
it should respect the annotations, rather than behave as if there are no
annotations.


Mathias wrote:
> (better formulation of my question)
>
> Hi Ed Merks,
>
> Thank you for the quick answer! Now the verification of my constraints
> works!
>
> For understanding (and for my master thesis :-))
>
> What you mean is that the resource implementation only uses the
> annotated kind (element, attribute,..) of the ecore model elements for
> serializing XML Schema instances (XML Documents). This means, that the
> option OPTION_EXTENDED_META_DATA only results in an analysis of the
> ExtendedMetaData.kind of the EObjects. Other XML Schema specific
> details (such as min/maxOccurs, wildcards) have no influence to the
> serialization (resource implementation), but to the Validator. Is this
> correct?
>
> Thank you again,
>
> Mathias
>
Re: Analysis of XML Schema specific annotations, properties in Resource Impl. [message #68231 is a reply to message #68219] Tue, 23 May 2006 07:35 Go to previous messageGo to next message
Eclipse User
Originally posted by: mathiasfrz.web.de

Hi Ed Merks,

Thank you for your answer!
I analyzed the classes XMLSaveImpl and XMLHelperImpl to get a better
understanding of the XML Schema specific serialization of Ecore instances.
My question: What is the role of the XMLMap class in difference to the
ExtendedMetaData class?

Thank you very much!!!

Mathias
Re: Analysis of XML Schema specific annotations, properties in Resource Impl. [message #68241 is a reply to message #68231] Tue, 23 May 2006 07:39 Go to previous messageGo to next message
Eclipse User
Originally posted by: merks.ca.ibm.com

Mathias,

XMLMap predates ExtendedMetaData and it is not as expressive and hence
not as accurate at supporting all the XML Schema features.


Mathias wrote:
> Hi Ed Merks,
>
> Thank you for your answer! I analyzed the classes XMLSaveImpl and
> XMLHelperImpl to get a better understanding of the XML Schema specific
> serialization of Ecore instances. My question: What is the role of the
> XMLMap class in difference to the ExtendedMetaData class?
>
> Thank you very much!!!
>
> Mathias
>
>
Re: Analysis of XML Schema specific annotations, properties in Resource Impl. [message #68253 is a reply to message #68241] Tue, 23 May 2006 07:50 Go to previous message
Eclipse User
Originally posted by: mathiasfrz.web.de

Thanks a lot!

mathias
Re: Analysis of XML Schema specific annotations, properties in Resource Impl. [message #598106 is a reply to message #68174] Fri, 19 May 2006 07:57 Go to previous message
Ed Merks is currently offline Ed Merks
Messages: 26014
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------040608070808040600060002
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit

Mathias,

The constraints, if any, are generated as part of the validator.

The EMF Validation Framework Overview
< http://www.eclipse.org/emf/docs.php?doc=references/overview/ EMF.Validation.html>

EObjectValidator does all the constraint checking for a dynamic model
and for generated models there will be a generated validator, if there
are constraints in the model. Constraints such as min/maxOccurs simply
map to multiplicities of the features and can those are checked by the
reflective EObjectValidator. Constraints such as facet constraints on
simple types will result in a generated validator. In general, you can
use Diagnostician.INSTANCE.validate(EObject) to check all the
constraints; that's effectively what right clicking and running
"Validate" in the generated editor will do.


Mathias wrote:
> Hi,
> I tried the serialization of XML Schema based (annotated) Ecore
> models. I tried this using the XMLResource.OPTION_EXTENDED_META_DATA
> option (and all other generated options) in the generated
> RessourceFactory. The result was an xml instance of the Schema which
> differentiates between attributes and elements as specified in the
> schema (example: nested elements specified in the schema are
> serialized as nested elements in the XML instance of the schema).
> After commenting out of XMLResource.OPTION_EXTENDED_META_DATA (and all
> the other options) all nested elements specified in the schema were
> serialized as attributes in a resulting xml instance of the schema. On
> the other hand, I found no checks of xml schema defined restrictions
> (like "minOccurs", "maxOccurs", "xmlns" for any) for the serialization
> of instances of the XMLSchema. Did I something wrong?
> .. Or results the option OPTION_EXTENDED_META_DATA only in analysis of
> the Annotation "kind" of the Ecore model ... and nothing more?
> Thank you very much! (And thank you for your last very fast (and
> helpful) answer!!!)
>
> Mathias
>
>


--------------040608070808040600060002
Content-Type: text/html; charset=ISO-8859-15
Content-Transfer-Encoding: 8bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-15"
http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Mathias,<br>
<br>
The constraints, if any, are generated as part of the validator. <br>
<blockquote><a
href=" http://www.eclipse.org/emf/docs.php?doc=references/overview/ EMF.Validation.html">
Re: Analysis of XML Schema specific annotations, properties in Resource Impl. [message #598113 is a reply to message #68185] Fri, 19 May 2006 08:38 Go to previous message
Mathias  is currently offline Mathias
Messages: 7
Registered: February 2010
Junior Member
Thank you for the quick answer! Now the verification of my constraints
works!

For understanding (and for my master thesis :-))

What you mean is that the resource implementation only uses the annotated
kind (element, attribute,..) of the ecore model elements for serializing
XML Schema instances (XML Documents).
This means, that the option OPTION_EXTENDED_META_DATA only results in an
analysis of the ExtendedMetaData.kind of the EObjects.
For checking other XML Schema specific details (such as min/maxOccurs,
wildcards) the Validator is used. Is this correct?

Thank you again,

Mathias
Re: Analysis of XML Schema specific annotations, properties in Resource Impl. [message #598117 is a reply to message #68197] Fri, 19 May 2006 08:50 Go to previous message
Mathias  is currently offline Mathias
Messages: 7
Registered: February 2010
Junior Member
(better formulation of my question)

Hi Ed Merks,

Thank you for the quick answer! Now the verification of my constraints
works!

For understanding (and for my master thesis :-))

What you mean is that the resource implementation only uses the annotated
kind (element, attribute,..) of the ecore model elements for serializing
XML Schema instances (XML Documents). This means, that the option
OPTION_EXTENDED_META_DATA only results in an analysis of the
ExtendedMetaData.kind of the EObjects. Other XML Schema specific details
(such as min/maxOccurs, wildcards) have no influence to the serialization
(resource implementation), but to the Validator. Is this correct?

Thank you again,

Mathias
Re: Analysis of XML Schema specific annotations, properties in Resource Impl. [message #598121 is a reply to message #68208] Fri, 19 May 2006 09:02 Go to previous message
Ed Merks is currently offline Ed Merks
Messages: 26014
Registered: July 2009
Senior Member
Mathias,

The annotation information comes into play in other places as well. For
example, an element wildcard's feature will only allow features that
correspond to global elements in its contents (and it enforces the
namespace constraint on the namespace of those elements as well). The
OPTION_EXTENDED_META_DATA is used merely to instruct the serializer that
it should respect the annotations, rather than behave as if there are no
annotations.


Mathias wrote:
> (better formulation of my question)
>
> Hi Ed Merks,
>
> Thank you for the quick answer! Now the verification of my constraints
> works!
>
> For understanding (and for my master thesis :-))
>
> What you mean is that the resource implementation only uses the
> annotated kind (element, attribute,..) of the ecore model elements for
> serializing XML Schema instances (XML Documents). This means, that the
> option OPTION_EXTENDED_META_DATA only results in an analysis of the
> ExtendedMetaData.kind of the EObjects. Other XML Schema specific
> details (such as min/maxOccurs, wildcards) have no influence to the
> serialization (resource implementation), but to the Validator. Is this
> correct?
>
> Thank you again,
>
> Mathias
>
Re: Analysis of XML Schema specific annotations, properties in Resource Impl. [message #598128 is a reply to message #68219] Tue, 23 May 2006 07:35 Go to previous message
Mathias  is currently offline Mathias
Messages: 7
Registered: February 2010
Junior Member
Hi Ed Merks,

Thank you for your answer!
I analyzed the classes XMLSaveImpl and XMLHelperImpl to get a better
understanding of the XML Schema specific serialization of Ecore instances.
My question: What is the role of the XMLMap class in difference to the
ExtendedMetaData class?

Thank you very much!!!

Mathias
Re: Analysis of XML Schema specific annotations, properties in Resource Impl. [message #598132 is a reply to message #68231] Tue, 23 May 2006 07:39 Go to previous message
Ed Merks is currently offline Ed Merks
Messages: 26014
Registered: July 2009
Senior Member
Mathias,

XMLMap predates ExtendedMetaData and it is not as expressive and hence
not as accurate at supporting all the XML Schema features.


Mathias wrote:
> Hi Ed Merks,
>
> Thank you for your answer! I analyzed the classes XMLSaveImpl and
> XMLHelperImpl to get a better understanding of the XML Schema specific
> serialization of Ecore instances. My question: What is the role of the
> XMLMap class in difference to the ExtendedMetaData class?
>
> Thank you very much!!!
>
> Mathias
>
>
Re: Analysis of XML Schema specific annotations, properties in Resource Impl. [message #598140 is a reply to message #68241] Tue, 23 May 2006 07:50 Go to previous message
Mathias  is currently offline Mathias
Messages: 7
Registered: February 2010
Junior Member
Thanks a lot!

mathias
Previous Topic:Analysis of XML Schema specific annotations, properties in Resource Impl.
Next Topic:Changing namespaces?
Goto Forum:
  


Current Time: Sat Aug 30 02:25:10 EDT 2014

Powered by FUDForum. Page generated in 0.02872 seconds