Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 322704 - xmi:id is not encoded for XML validity
Summary: xmi:id is not encoded for XML validity
Status: RESOLVED WONTFIX
Alias: None
Product: EMF
Classification: Modeling
Component: Core (show other bugs)
Version: 2.6.0   Edit
Hardware: PC Windows Vista
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Ed Merks CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-08-14 07:29 EDT by Ed Willink CLA
Modified: 2010-08-14 11:43 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ed Willink CLA 2010-08-14 07:29:07 EDT
If an EObject has an ID with a <, the < is output unchanged to XMI. e.g.

        <ownedParameter xsi:type="pivot:TypeTemplateParameter"
            xmi:id="oclM1::Bag<T>::T"
            parameteredElement="#oclM1::Bag<T>::T">

which of course gives an error when the XML is reloaded.
Comment 1 Ed Merks CLA 2010-08-14 11:43:43 EDT
We won't go through the additional expense of encoding ID values (scan every character of every ID that's ever serialized). I'm pretty sure that XMI requires they be well formed identifiers the same as xsd:ID so even escaping them wouldn't produce valid XMI; one would need an encoding scheme using % or something like that.  In any case, at least with EMF, it's up to you to ensure IDs are NCNames when you assign them.  Or at the very least, don't include whitespace, ":", or "#", or any other characters like <, ', ", or & with special XML meaning.  Definitely values like what you're showing that are arbitrary expressions.