Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Namespace issues with UML and XMI having 2013 vs 2016 versions #7

Closed
ronaldtse opened this issue May 23, 2024 · 2 comments · Fixed by #8 · May be fixed by #13
Closed

Namespace issues with UML and XMI having 2013 vs 2016 versions #7

ronaldtse opened this issue May 23, 2024 · 2 comments · Fixed by #8 · May be fixed by #13
Labels
bug Something isn't working

Comments

@ronaldtse
Copy link
Contributor

ronaldtse commented May 23, 2024

Right now in the round-trip task, the <profiles> tag is entirely missing because:

       -    <profiles>
       -      <uml:Profile xmlns:uml="http://www.omg.org/spec/UML/20161101" xmlns:xmi="http://www.omg.org/spec/XMI/20161101" xmi:id="thecustomprofile" nsPrefix="thecustomprofile" name="thecustomprofile" metamodelReference="mmref01">

The <uml:Profile> tag uses:

  • xmlns:uml="http://www.omg.org/spec/UML/20161101"
  • xmlns:xmi="http://www.omg.org/spec/XMI/20161101"

But the rest of the document uses:

  • xmlns:uml="http://www.omg.org/spec/UML/20131001"
  • xmlns:xmi="http://www.omg.org/spec/XMI/20131001"

The way to solve this is to only apply the newer namespace on this particular Profile element. This means that all the 'uml' and 'xmi' element inside here need to be a different set of Ruby classes that inherit from the old version (2013).

e.g. uml:Profile contains ownedComment, packageImport, packagedElement etc.

Potential solution:

class Uml2016::OwnedComment < Uml2013::OwnedComment
  xml do
    # ...
    namespace "http://www.omg.org/spec/UML/20161101", "uml"
  end
end

class Uml2016::Profile < Shale::Mapper
  attribute :owned_comment, Uml2016::OwnedComment
  xml do
    root 'Profile'
    namespace "http://www.omg.org/spec/UML/20161101", "uml"
    map_attribute `ownedComment`, to: :owned_comment
  end
end
@ronaldtse
Copy link
Contributor Author

This issue is actually not fixed.

@kwkwan
Copy link
Contributor

kwkwan commented Jun 7, 2024

Closed #7 as completed in 66ca2f0

@kwkwan kwkwan closed this as completed Jun 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants