|
Re: Ecore id attribute with spaces [message #418969 is a reply to message #418964] |
Tue, 06 May 2008 09:20 |
Ed Merks 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/
|
|
|
Powered by
FUDForum. Page generated in 0.02827 seconds