Adding extra information during serialization [message #608530] |
Mon, 23 April 2007 14:20 |
Ronan Mulvaney Messages: 18 Registered: July 2009 |
Junior Member |
|
|
Sorry about the cross group post I've a feeling this may relate more to
the EMF project rather than UML2.
We currently have a UML2 model whose XMI storage looks like so (for
example):
<?xml version="1.0" encoding="UTF-8"?>
<xmi:XMI xmi:version="2.1" ....
<uml:Model xmi:id="_TP5sT_GIEduRu-oCVZLYQw" name="Ronan">
<packagedElement xmi:type="uml:Package"
xmi:id="_TP5sUPGIEduRu-oCVZLYQw" name="ParentPackage">
<packagedElement xmi:type="uml:Package"
xmi:id="_TQ8N8fGIEduRu-oCVZLYQw" name="ChildPackage">
.......
</uml:Model>
<Ronan:test_package
xmi:id="_TRF-gPGIEduRu-oCVZLYQw"
base_Package="_TP5sUPGIEduRu-oCVZLYQw"/>
<Ronan:test_package
xmi:id="_TRsdHvGIEduRu-oCVZLYQw"
base_Package="_TQ8N8fGIEduRu-oCVZLYQw"/>
</xmi:XMI>
I am looking to store additional information on each element under the
<uml:Model> element.
The information that I am looking to hold is the location in the model
tree or well qualified name of the element e.g.
<packagedElement xmi:type="uml:Package"
xmi:id="_TP5sUPGIEduRu-oCVZLYQw" name="ParentPackage"
qualifiedName="Ronan::ParentPackage">
Although that addition (qualifiedName) naturally invalidates the schema
but should work to show something like the ideal content.
Is there anything here that EMF/UML2 allows me access easy to or best
approach here?
I can add a comment above each line via overriding certain methods in
the XMLSaveImpl class, however this looks a bit mucky since I can't seem
to get access to the current indent.
This additional information is required for users looking at the model
file who may not be familiar with the XMI storage constructs and want to
relate changes in the file with what they see through the editor.
Thanks in advance.
Ronan
|
|
|
Powered by
FUDForum. Page generated in 0.02726 seconds