Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Ecore id attribute with spaces
Ecore id attribute with spaces [message #418964] Tue, 06 May 2008 02:32 Go to next message
Will Horn is currently offline Will HornFriend
Messages: 265
Registered: July 2009
Senior Member
Is it expected that the id attribute will not have spaces? I have run
into a problem when I serialize (XMI) an EList that that is not a
containment feature. This serializes the ids of all the EObjects in the
list into a single attribute separated by spaces. When one of the
EObjects had an id with a space in it, the serialized document could not
be deserialized.

Is there a workaround for id's with spaces? If not, maybe a way to
catch the error during serialization instead of allowing an unreadable
document to be created?

Thanks always,
Will
Re: Ecore id attribute with spaces [message #418969 is a reply to message #418964] Tue, 06 May 2008 09:20 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33140
Registered: July 2009
Senior Member
Will,

Comments below.


Will Horn wrote:
> Is it expected that the id attribute will not have spaces?
It's generally best they conform to XML Schema's ID type (non-colonized
name).
> I have run into a problem when I serialize (XMI) an EList that that is
> not a containment feature. This serializes the ids of all the
> EObjects in the list into a single attribute separated by spaces.
If there were cross document references, it would use a list of elements
with hrefs, which would work okay.
> When one of the EObjects had an id with a space in it, the
> serialized document could not be deserialized.
Spaces are uses to separate IDs, so that's no so surprising...
>
> Is there a workaround for id's with spaces?
If you're going to use an attribute who's string value can contain ":",
" ", or "#", it's best ensure that the data type used for it will encode
those special characters.
> If not, maybe a way to catch the error during serialization instead of
> allowing an unreadable document to be created?
If you use XMLTypePackage's ID EDataType for the ID EAttribute's type,
validation will detect values that are properly conforming ID values.
>
> Thanks always,
> Will


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:Listening for Transaction Begin
Next Topic:ChangeDesciption issue
Goto Forum:
  


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

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

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

Back to the top