On Sun, Jun 5, 2016 at 1:54 AM, Peter Uhnak <i.uhnak(a)gmail.com> wrote:
Hi,
XMI is a subset of XML with some more well-defined behavior.
I wrote a tool that can process XML files exhibiting certain XMI properties.
the repo is here:
https://github.com/peteruhnak/xmi-analyzer
I don't know if Usman had chance to work with it in practice, but if Synectique has
any feedback or feature requests then let me know.
You are right that if you have XML Schema (or model-compliant XMI), then processing the
XML can be fully automated.
Unfortunately implementing full support for that is quite a lot of work, that's why
my xmi-analyzer takes shortcuts.
I suggest you give it a try, or send me an example of your XML file and maybe we can
improve it.
XSD is wanted, but nowhere in sight, maybe Monty (current mastermind behind XML-Parser)
may have an idea of the complexity of it?
Peter
Hi Peter,
Great to hear of this. A CIM importer was a missing part from my
Masters project a few years ago on the IEC61970 Common Information
Model [1]. This has about 800 classes and 800 relationships between
them is maintained as a UML diagram using Enterprise Architect, from
which the IEC standard is generated. EA can export CIM, but at the
time I could not find such an importer and had to hack my own import
process from the raw EA file.
[1]
https://en.wikipedia.org/wiki/Common_Information_Model_(electricity)
I downloaded the latest CIM.xmi file to try it, and I get a RBParser
syntax error...
thecustomprofile:Compound
^ <RED>Variable or expression expected</RED>
-> thecustomprofile:Compound
where the <RED> line is error inserted in red coloured text.
The immediate problem being the colon in the identifier.
I tracked this down as coming from the use of a namespace like this...
<xmi:XMI xmi:version="2.1"
xmlns:uml="http://schema.omg.org/spec/UML/2.1"
xmlns:xmi="http://schema.omg.org/spec/XMI/2.1"
xmlns:thecustomprofile="http://www.sparxsystems.com/profiles/thecustom…
xmlns:EAUML="http://www.sparxsystems.com/profiles/EAUML/1.0">
....
<thecustomprofile:Compound
base_Class="EAID_1BEA10DB_2F71_467b_82A6_6C453C5657A5"/>
How can I work around this?
Now "thecustomprofile" is Enterprise Architect related (i.e. the
editing tool) and *nothing* to do with the domain, so I guess it could
be thrown away. I notice down the stack that XLMElement has
variables...
name ==> thecustomprofile:Compound
localName ==> Compound
so in XACLassStructureGenerator>>processElement:
I changed "self ensureAttributeWithAccessor: anElement name..."
to "self ensureAttributeWithAccessor: anElement localName..."
and it seems to have got further. I'm now looking at the next bump in the road.
cheers -ben