+
Skip to content

XMI serialization compatibility with Eclipse #145

Open
@jasonwickers

Description

@jasonwickers

Hello!

I've been using pyecore and love it. I found a compatibility issue in pyecore 0.15.1 (and previous versions) when opening models created in eclipse, updating with pyecore, serializing with pyecore, and trying to re-open in Eclipse (EMF Ecore 2.22.0, EMF XML/XMI Persistence 2.16.0) while using and keeping uuid. I found two things and have tried the potential fixes which seem to work:

  1. Eclipse is expecting that the id attribute not be xmi:id but just simply id on the tag.
    Potential fix: in _go_across method in xmi.py > XMIResource , at line 416, change
    xmi_id = f'{{{XMI_URL}}}id' to
    xmi_id = 'id'

  2. Eclipse is expecting that id references start with # and not just be the id of the element
    Potential fix: in in _build_path_from method in resource.py > Resource, at line 580, change...
    return (obj._internal_id, False) to
    return ('#' + obj._internal_id, False)

With the potential fixes above the models load in eclipse without issue. Thanks again for your effort in the pyecore project!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载