XSD for XMI 2.1.1 [英] XSD for XMI 2.1.1

查看:100
本文介绍了XSD for XMI 2.1.1的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我必须使用JAXB解析XMI文件(xmi版本2.1.1)。

I have to parse a XMI file (xmi version 2.1.1) using JAXB.

为此,我必须生成与XMI文件对应的Java类。
所以我需要一个xmi文件的shema定义来使用jxc工具。

For that, I have to generate Java classes corresponding to a XMI file. So I need a shema definition of a xmi file to do that with the jxc tool.

我希望有人知道我在哪里可以找到这个文件。
预先感谢您的帮助!

I hope anyone know where I can find this file. Thanks in advance for help !

编辑:有关更多信息,有一个xmi文件的例子(使用modelio生成):

Edit : for more informations, there is an exemple of a xmi file (generated using modelio) :

<?xml version="1.0" encoding="UTF-8"?>
<uml:Model xmlns:uml="http://schema.omg.org/spec/UML/2.1.1" xmlns:xmi="http://schema.omg.org/spec/XMI/2.1" xmi:version="2.1" xmi:id="_1cUA4Pm5EeKGw-fe2JKgbQ" name="test">
  <eAnnotations xmi:id="_1cUA4fm5EeKGw-fe2JKgbQ" source="Objing">
    <contents xmi:type="uml:Property" xmi:id="_1cUA4vm5EeKGw-fe2JKgbQ" name="exporterVersion">
      <defaultValue xmi:type="uml:LiteralString" xmi:id="_1cUA4_m5EeKGw-fe2JKgbQ" value="2.2"/>
    </contents>
  </eAnnotations>
  <ownedComment xmi:type="uml:Comment" xmi:id="_1cUA5Pm5EeKGw-fe2JKgbQ">
    <body/>
  </ownedComment>
  <packagedElement xmi:type="uml:Class" xmi:id="_1cUA5fm5EeKGw-fe2JKgbQ" name="User">
    <ownedAttribute xmi:type="uml:Property" xmi:id="_1cUA5vm5EeKGw-fe2JKgbQ" name="login" visibility="private" isUnique="false" isReadOnly="true">
      <type xmi:type="uml:PrimitiveType" href="http://schema.omg.org/spec/UML/2.1.1/uml.xml#String"/>
    </ownedAttribute>
    <ownedAttribute xmi:type="uml:Property" xmi:id="_1cUA5_m5EeKGw-fe2JKgbQ" name="id" visibility="private" isUnique="false" isReadOnly="true">
      <type xmi:type="uml:PrimitiveType" href="http://schema.omg.org/spec/UML/2.1.1/uml.xml#Integer"/>
    </ownedAttribute>
  </packagedElement>
  <packagedElement xmi:type="uml:Association" xmi:id="_1cUA6Pm5EeKGw-fe2JKgbQ" memberEnd="_1cUA6fm5EeKGw-fe2JKgbQ _1cUA7fm5EeKGw-fe2JKgbQ">
    <ownedEnd xmi:type="uml:Property" xmi:id="_1cUA6fm5EeKGw-fe2JKgbQ" type="_1cUA6_m5EeKGw-fe2JKgbQ" association="_1cUA6Pm5EeKGw-fe2JKgbQ">
      <lowerValue xmi:type="uml:LiteralInteger" xmi:id="_1cUA6vm5EeKGw-fe2JKgbQ"/>
    </ownedEnd>
  </packagedElement>
  <packagedElement xmi:type="uml:Class" xmi:id="_1cUA6_m5EeKGw-fe2JKgbQ" name="Group">
    <ownedAttribute xmi:type="uml:Property" xmi:id="_1cUA7Pm5EeKGw-fe2JKgbQ" name="label" visibility="private" isUnique="false" isReadOnly="true">
      <type xmi:type="uml:PrimitiveType" href="http://schema.omg.org/spec/UML/2.1.1/uml.xml#String"/>
    </ownedAttribute>
    <ownedAttribute xmi:type="uml:Property" xmi:id="_1cUA7fm5EeKGw-fe2JKgbQ" name="user" type="_1cUA5fm5EeKGw-fe2JKgbQ" isReadOnly="true" aggregation="shared" association="_1cUA6Pm5EeKGw-fe2JKgbQ">
      <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_1cUA7vm5EeKGw-fe2JKgbQ" value="*"/>
      <lowerValue xmi:type="uml:LiteralInteger" xmi:id="_1cUA7_m5EeKGw-fe2JKgbQ"/>
    </ownedAttribute>
  </packagedElement>
</uml:Model>


推荐答案

您可以在OMG网站上找到XMI XSD < a href =http://www.omg.org/spec/XMI/20071001/07-10-06.xsd =nofollow> XMI XSD 2.1.1
但你会还需要 UML Schema
MOF架构

You can find the XMI XSD on the OMG website XMI XSD 2.1.1 but you will also need the UML Schema and the MOF Schema.

A读取和编写UML XMI文件的更好方法是使用 Eclipse UML实现
它可以在Eclipse之外的一个简单的Java程序中轻松使用:参见

A better way to read and write UML XMI files is to use the Eclipse UML implementation. It can easily be used outside Eclipse in a simple Java program : see

这篇关于XSD for XMI 2.1.1的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆