| Summary: | xmi:id is not encoded for XML validity | ||
|---|---|---|---|
| Product: | [Modeling] EMF | Reporter: | Ed Willink <ed> |
| Component: | Core | Assignee: | Ed Merks <Ed.Merks> |
| Status: | RESOLVED WONTFIX | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | ||
| Version: | 2.6.0 | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Windows Vista | ||
| Whiteboard: | |||
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. |
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.