Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [emf-dev] XML marchalling/unmarshalling



Boris,

This is a limitation in 1.x.  The XMLMap API has this method:

   EStructuralFeature getFeature(EClass eClass, String namespaceURI, String
   name);

so it cannot distiguish between an element and an attribute with the same
name.

In 2.0, the ExtendedMetaData API is used and it has these methods:

     EStructuralFeature getAttribute(EClass eClass, String namespace,
   String name);
     EStructuralFeature getElement(EClass eClass, String namespace, String
   name);

so it can handle the case of an element and an attribute with the same name
and namespace.

It's better to discuss issues like this in the newsgroup so that more folks
will benefit from the questions and the answers...


Ed Merks/Toronto/IBM@IBMCA
mailto: merks@xxxxxxxxxx
905-413-3265  (t/l 969)




                                                                                                                                                
                      "Lublinsky,Boris                                                                                                          
                      S."                      To:       <emf-dev@xxxxxxxxxxx>                                                                  
                      <Boris.Lublinsky@        cc:       "Catherine Griffin" <catherine_griffin@xxxxxxxxxx>                                     
                      CNA.com>                 Subject:  [emf-dev] XML marchalling/unmarshalling                                                
                      Sent by:                                                                                                                  
                      emf-dev-admin@ecl                                                                                                         
                      ipse.org                                                                                                                  
                                                                                                                                                
                                                                                                                                                
                      01/29/2004 03:35                                                                                                          
                      PM                                                                                                                        
                      Please respond to                                                                                                         
                      emf-dev                                                                                                                   
                                                                                                                                                
                                                                                                                                                






I was experimenting with marshalling/unmarshalling XML using EMF1.1.1 and
XSD1.1.1 and it works great, except when you have a name collision between
elements and attributes - quite valid thing for XML. What is happening in
this case - generation works fine, marshalling to XML works correctly, but
produced XML won't unmarshall. Enclosed are my schemas - I split them in 4,
but it does not matter

 <<writer.xsd>>  <<Book.xsd>>  <<generic.xsd>>  <<libraryV3.xsd>>
And XML sample, that will not unmarshall correctly

 <<My.library>>







#### writer.xsd has been removed from this note on January 29 2004 by Ed
Merks
#### Book.xsd has been removed from this note on January 29 2004 by Ed
Merks
#### generic.xsd has been removed from this note on January 29 2004 by Ed
Merks
#### libraryV3.xsd has been removed from this note on January 29 2004 by Ed
Merks
#### My.library has been removed from this note on January 29 2004 by Ed
Merks




Back to the top