Вопрос

I really just need to be able to validate that the XMI file I'm receiving is compliant with the XMI standard set by OMG.

For example,

I have a file that starts like this...

<?xml version="1.0" encoding="UTF-8"?>
<xmi:XMI xmlns:uml="http://www.omg.org/spec/UML/20090901" xmlns:xmi="http://www.omg.org/spec/XMI/20100901" xmlns:StandardProfileL3="http://schema.omg.org/spec/UML/2.3/StandardProfileL3.xmi"  xmlns:StandardProfileL2="http://schema.omg.org/spec/UML/2.3/StandardProfileL2.xmi" xmi:version="2.4" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.omg.org/spec/XMI/20100901 file:///D:/data/tools/Altova/XMI.xsd">
    <xmi:Documentation exporter="Altova" exporterVersion="1.0"/>
    <uml:Model xmi:id="eee_1045467100313_135436_1" name="Data" visibility="public">
        <ownedComment xmi:type="uml:Comment" xmi:id="_17_0_8ce027f_1306433568482_126880_1517" body="Created:6/26/11 3:32">

The first part validates just fine but as soon as it hits the uml:Model it throws an error. I've looked on OMGs website and I can't find a schema to validate the UML part of this. Do I need to write one myself? Am I even doing this right, I haven't really had any previous expirence and some work demands don't allow me the time to properly educate myself. Any and all help/advice is appreciated! Thanks in advance!

Это было полезно?

Решение

I'm looking for some Schema-Files for OMG-UML-Validation, but also found nothing. On the official OMG-Website are only Xml-Examples and Specification in pdf/ps.

From your given XML it is clear that there is no namespace declared for UML.

The Namespace for uml is definied in the root-element of the xml.

<xmi:XMI xmlns:uml="http://www.omg.org/spec/UML/20090901" [...]>

Другие советы

<uml:Model xmi:id="eee_1045467100313_135436_1" name="Data" visibility="public">

From your given XML it is clear that there is no namespace declared for UML.

So summary is, the xml u r receiving is invalid.

Wish it will be helpful.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top