Added parsing of operations from the XMI. Do we have enough to do the Rational Profil...
Mark Addison [Tue, 9 Sep 2003 01:37:25 +0000 (01:37 +0000)]
lib/SQL/Translator/Parser/XML/XMI.pm
t/data/xmi/Foo.poseidon2.xmi
t/data/xmi/Foo.poseidon2.zuml

index 5716ae9..68932de 100644 (file)
@@ -1,7 +1,7 @@
 package SQL::Translator::Parser::XML::XMI;
 
 # -------------------------------------------------------------------
-# $Id: XMI.pm,v 1.4 2003-09-09 01:00:44 grommit Exp $
+# $Id: XMI.pm,v 1.5 2003-09-09 01:37:25 grommit Exp $
 # -------------------------------------------------------------------
 # Copyright (C) 2003 Mark Addison <mark.addison@itn.co.uk>,
 #
@@ -82,7 +82,7 @@ translated.
 use strict;
 
 use vars qw[ $DEBUG $VERSION @EXPORT_OK ];
-$VERSION = sprintf "%d.%02d", q$Revision: 1.4 $ =~ /(\d+)\.(\d+)/;
+$VERSION = sprintf "%d.%02d", q$Revision: 1.5 $ =~ /(\d+)\.(\d+)/;
 $DEBUG   = 0 unless defined $DEBUG;
 
 use Data::Dumper;
@@ -159,12 +159,15 @@ sub get_classes {
                }
                $class->{stereotype} = get_stereotype($classnode);
 
-               # Class Attributes
-               my $xpath = 'UML:Classifier.feature/UML:Attribute';
         $class->{attributes} = get_attributes( $classnode,
-            xpath => $xpath, test => $args{attribute_test} );
+            xpath => 'UML:Classifier.feature/UML:Attribute',
+            test => $args{attribute_test} );
         
-               push @$classes, $class;
+        $class->{operations} = get_operations( $classnode,
+            xpath => '//UML:Classifier.feature/UML:Operation',
+            test => $args{operation_test} );
+               
+        push @$classes, $class;
        }
        return wantarray ? @$classes : $classes;
 };
@@ -185,7 +188,7 @@ sub get_attributes {
         }
         $attr->{stereotype} = get_stereotype($node);
 
-        # Get datatype name and the name body of the initial value
+        # Get datatype name and the body of the initial value
         $attr->{datatype} = "".$node->find(
               'xmiDeref(UML:StructuralFeature.type/UML:DataType)/@name');
         if ( my @body = $node->findnodes(
@@ -199,7 +202,56 @@ sub get_attributes {
     return wantarray ? @$attributes : $attributes;
 }
 
+sub get_operations {
+    my ($xp, %args) = @_;
+
+       my $xpath = $args{xpath} ||= '//UML:Classifier.feature/UML:Operation';
+    $xpath = _add_xpath_tests $xpath, $args{test};
+       debug "Searching for operations using:$xpath";
+       
+    my $operations;
+    foreach my $node ( $xp->findnodes($xpath) ) {
+        my $operation = {};
+        
+        foreach (qw/name visibility isSpecification ownerScope isQuery
+            concurrency isRoot isLeaf isAbstract/) {
+            $operation->{$_} = $node->getAttribute($_);
+        }
+        $operation->{stereotype} = get_stereotype($node);
+
+        $operation->{parameters} = get_parameters( $node,
+            xpath => 'UML:BehavioralFeature.parameter/UML:Parameter',
+            test  => $args{attribute_test} 
+        );
+        
+        push @$operations, $operation;
+    }
+    return wantarray ? @$operations : $operations;
+}
+
+sub get_parameters {
+    my ($xp, %args) = @_;
 
+       my $xpath = $args{xpath} ||= '//UML:Classifier.feature/UML:Attribute';
+    $xpath = _add_xpath_tests $xpath, $args{test};
+       debug "Searching for Attributes using:$xpath";
+       
+    my $parameters;
+    foreach my $node ( $xp->findnodes($xpath) ) {
+        my $parameter = {};
+        
+        foreach (qw/name isSpecification kind/) {
+            $parameter->{$_} = $node->getAttribute($_);
+        }
+        $parameter->{stereotype} = get_stereotype($node);
+
+        $parameter->{datatype} = "".$node->find(
+              'xmiDeref(UML:Parameter.type/UML:DataType)/@name');
+        
+        push @$parameters, $parameter;
+    }
+    return wantarray ? @$parameters : $parameters;
+}
 
 # SQLFairy Parser
 #-----------------------------------------------------------------------------
@@ -416,6 +468,9 @@ big and complex, especially all the diagram info.
 B<field sizes> Don't think UML does this directly so may need to include
 it in the datatype names.
 
+B<Check the Tag Attribute lists in get_* subs> I have taken them from looking
+at Poseidon so need to check against XMI spec.
+
 B<table_visibility and field_visibility args> Seperate control over what is 
 parsed, setting visibility arg will set both.
 
index c4694e9..d2b6975 100644 (file)
-<?xml version = '1.0' encoding = 'UTF-8' ?>\r
-<XMI xmi.version = '1.2' xmlns:UML = 'org.omg.xmi.namespace.UML' timestamp = 'Thu Sep 04 21:40:07 BST 2003'>\r
-  <XMI.header>\r
-    <XMI.documentation>\r
-      <XMI.exporter>Netbeans XMI Writer</XMI.exporter>\r
-      <XMI.exporterVersion>1.0</XMI.exporterVersion>\r
-    </XMI.documentation>\r
-  </XMI.header>\r
-  <XMI.content>\r
-    <UML:Multiplicity xmi.id = '3b4b1e:f762a35f6b:-7f41'>\r
-      <UML:Multiplicity.range>\r
-        <UML:MultiplicityRange xmi.id = '3b4b1e:f762a35f6b:-7f40' lower = '1' upper = '1'/>\r
-      </UML:Multiplicity.range>\r
-    </UML:Multiplicity>\r
-    <UML:Model xmi.id = '3b4b1e:f762a35f6b:-7ff9' name = 'model 2' isSpecification = 'false'\r
-      isRoot = 'false' isLeaf = 'false' isAbstract = 'false'>\r
-      <UML:Namespace.ownedElement>\r
-        <UML:Class xmi.id = '3b4b1e:f762a35f6b:-7ff8' name = 'Foo' visibility = 'public'\r
-          isSpecification = 'false' isRoot = 'false' isLeaf = 'false' isAbstract = 'false'\r
-          isActive = 'false'>\r
-          <UML:ModelElement.stereotype>\r
-            <UML:Stereotype xmi.idref = '3b4b1e:f762a35f6b:-7fb6'/>\r
-          </UML:ModelElement.stereotype>\r
-          <UML:Classifier.feature>\r
-            <UML:Attribute xmi.id = '3b4b1e:f762a35f6b:-7ff6' name = 'fooid' visibility = 'public'\r
-              isSpecification = 'false' ownerScope = 'instance'>\r
-              <UML:ModelElement.stereotype>\r
-                <UML:Stereotype xmi.idref = '3b4b1e:f762a35f6b:-7ec8'/>\r
-              </UML:ModelElement.stereotype>\r
-              <UML:ModelElement.taggedValue>\r
-                <UML:TaggedValue xmi.id = '3b4b1e:f762a35f6b:-7e5e' isSpecification = 'false'>\r
+<?xml version = '1.0' encoding = 'UTF-8' ?>
+<XMI xmi.version = '1.2' xmlns:UML = 'org.omg.xmi.namespace.UML' timestamp = 'Tue Sep 09 00:09:56 BST 2003'>
+  <XMI.header>
+    <XMI.documentation>
+      <XMI.exporter>Netbeans XMI Writer</XMI.exporter>
+      <XMI.exporterVersion>1.0</XMI.exporterVersion>
+    </XMI.documentation>
+  </XMI.header>
+  <XMI.content>
+    <UML:Multiplicity xmi.id = '3b4b1e:f762a35f6b:-7f41'>
+      <UML:Multiplicity.range>
+        <UML:MultiplicityRange xmi.id = '3b4b1e:f762a35f6b:-7f40' lower = '1' upper = '1'/>
+      </UML:Multiplicity.range>
+    </UML:Multiplicity>
+    <UML:Model xmi.id = '3b4b1e:f762a35f6b:-7ff9' name = 'model 2' isSpecification = 'false'
+      isRoot = 'false' isLeaf = 'false' isAbstract = 'false'>
+      <UML:Namespace.ownedElement>
+        <UML:Class xmi.id = '3b4b1e:f762a35f6b:-7ff8' name = 'Foo' visibility = 'public'
+          isSpecification = 'false' isRoot = 'false' isLeaf = 'false' isAbstract = 'false'
+          isActive = 'false'>
+          <UML:ModelElement.stereotype>
+            <UML:Stereotype xmi.idref = '3b4b1e:f762a35f6b:-7fb6'/>
+          </UML:ModelElement.stereotype>
+          <UML:Classifier.feature>
+            <UML:Attribute xmi.id = '3b4b1e:f762a35f6b:-7ff6' name = 'fooid' visibility = 'public'
+              isSpecification = 'false' ownerScope = 'instance'>
+              <UML:ModelElement.stereotype>
+                <UML:Stereotype xmi.idref = '3b4b1e:f762a35f6b:-7ec8'/>
+              </UML:ModelElement.stereotype>
+              <UML:ModelElement.taggedValue>
+                <UML:TaggedValue xmi.id = '3b4b1e:f762a35f6b:-7e5e' isSpecification = 'false'>
                   <UML:TaggedValue.dataValue>&lt;p&gt;
 
 &lt;/p&gt;
-</UML:TaggedValue.dataValue>\r
-                  <UML:TaggedValue.type>\r
-                    <UML:TagDefinition xmi.idref = '3b4b1e:f762a35f6b:-7fa6'/>\r
-                  </UML:TaggedValue.type>\r
-                </UML:TaggedValue>\r
-              </UML:ModelElement.taggedValue>\r
-              <UML:StructuralFeature.type>\r
-                <UML:DataType xmi.idref = '3b4b1e:f762a35f6b:-7ff5'/>\r
-              </UML:StructuralFeature.type>\r
-            </UML:Attribute>\r
-            <UML:Attribute xmi.id = '3b4b1e:f762a35f6b:-7ff4' name = 'name' visibility = 'public'\r
-              isSpecification = 'false' ownerScope = 'instance'>\r
-              <UML:Attribute.initialValue>\r
-                <UML:Expression xmi.id = '3b4b1e:f762a35f6b:-7e56' language = 'java' body = ''/>\r
-              </UML:Attribute.initialValue>\r
-              <UML:StructuralFeature.type>\r
-                <UML:DataType xmi.idref = '3b4b1e:f762a35f6b:-7f70'/>\r
-              </UML:StructuralFeature.type>\r
-            </UML:Attribute>\r
-            <UML:Attribute xmi.id = '3b4b1e:f762a35f6b:-7e31' name = 'protectedname'\r
-              visibility = 'protected' isSpecification = 'false' ownerScope = 'instance'>\r
-              <UML:StructuralFeature.type>\r
-                <UML:DataType xmi.idref = '3b4b1e:f762a35f6b:-7f70'/>\r
-              </UML:StructuralFeature.type>\r
-            </UML:Attribute>\r
-            <UML:Attribute xmi.id = '3b4b1e:f762a35f6b:-7e30' name = 'privatename' visibility = 'private'\r
-              isSpecification = 'false' ownerScope = 'instance'>\r
-              <UML:StructuralFeature.type>\r
-                <UML:DataType xmi.idref = '3b4b1e:f762a35f6b:-7f70'/>\r
-              </UML:StructuralFeature.type>\r
-            </UML:Attribute>\r
-          </UML:Classifier.feature>\r
-        </UML:Class>\r
-        <UML:Package xmi.id = '3b4b1e:f762a35f6b:-7ff3' name = 'java' isSpecification = 'false'\r
-          isRoot = 'false' isLeaf = 'false' isAbstract = 'false'>\r
-          <UML:Namespace.ownedElement>\r
-            <UML:Package xmi.id = '3b4b1e:f762a35f6b:-7ff2' name = 'lang' isSpecification = 'false'\r
-              isRoot = 'false' isLeaf = 'false' isAbstract = 'false'>\r
-              <UML:Namespace.ownedElement>\r
-                <UML:DataType xmi.id = '3b4b1e:f762a35f6b:-7ff5' name = 'int' isSpecification = 'false'\r
-                  isRoot = 'false' isLeaf = 'false' isAbstract = 'false'/>\r
-                <UML:DataType xmi.id = '3b4b1e:f762a35f6b:-7ff1' name = 'void' isSpecification = 'false'\r
-                  isRoot = 'false' isLeaf = 'false' isAbstract = 'false'/>\r
-                <UML:DataType xmi.id = '3b4b1e:f762a35f6b:-7fb8' name = 'char' isSpecification = 'false'\r
-                  isRoot = 'false' isLeaf = 'false' isAbstract = 'false'/>\r
-              </UML:Namespace.ownedElement>\r
-            </UML:Package>\r
-          </UML:Namespace.ownedElement>\r
-        </UML:Package>\r
-        <UML:Stereotype xmi.id = '3b4b1e:f762a35f6b:-7fb4' name = 'entity' isSpecification = 'false'\r
-          isRoot = 'false' isLeaf = 'false' isAbstract = 'false'>\r
-          <UML:Stereotype.baseClass>Class</UML:Stereotype.baseClass>\r
-        </UML:Stereotype>\r
-        <UML:Stereotype xmi.id = '3b4b1e:f762a35f6b:-7fb6' name = 'Table' visibility = 'public'\r
-          isSpecification = 'false' isRoot = 'false' isLeaf = 'false' isAbstract = 'false'>\r
-          <UML:Stereotype.baseClass>Class</UML:Stereotype.baseClass>\r
-        </UML:Stereotype>\r
-        <UML:Class xmi.id = '3b4b1e:f762a35f6b:-7fa8' name = 'NotMe' visibility = 'public'\r
-          isSpecification = 'false' isRoot = 'false' isLeaf = 'false' isAbstract = 'false'\r
-          isActive = 'false'>\r
-          <UML:ModelElement.taggedValue>\r
-            <UML:TaggedValue xmi.id = '3b4b1e:f762a35f6b:-7fa7' isSpecification = 'false'>\r
+</UML:TaggedValue.dataValue>
+                  <UML:TaggedValue.type>
+                    <UML:TagDefinition xmi.idref = '3b4b1e:f762a35f6b:-7fa6'/>
+                  </UML:TaggedValue.type>
+                </UML:TaggedValue>
+              </UML:ModelElement.taggedValue>
+              <UML:StructuralFeature.type>
+                <UML:DataType xmi.idref = '3b4b1e:f762a35f6b:-7ff5'/>
+              </UML:StructuralFeature.type>
+            </UML:Attribute>
+            <UML:Attribute xmi.id = '3b4b1e:f762a35f6b:-7ff4' name = 'name' visibility = 'public'
+              isSpecification = 'false' ownerScope = 'instance'>
+              <UML:Attribute.initialValue>
+                <UML:Expression xmi.id = '3b4b1e:f762a35f6b:-7e56' language = 'java' body = ''/>
+              </UML:Attribute.initialValue>
+              <UML:StructuralFeature.type>
+                <UML:DataType xmi.idref = '3b4b1e:f762a35f6b:-7f70'/>
+              </UML:StructuralFeature.type>
+            </UML:Attribute>
+            <UML:Attribute xmi.id = '3b4b1e:f762a35f6b:-7e31' name = 'protectedname'
+              visibility = 'protected' isSpecification = 'false' ownerScope = 'instance'>
+              <UML:StructuralFeature.type>
+                <UML:DataType xmi.idref = '3b4b1e:f762a35f6b:-7f70'/>
+              </UML:StructuralFeature.type>
+            </UML:Attribute>
+            <UML:Attribute xmi.id = '3b4b1e:f762a35f6b:-7e30' name = 'privatename' visibility = 'private'
+              isSpecification = 'false' ownerScope = 'instance'>
+              <UML:StructuralFeature.type>
+                <UML:DataType xmi.idref = '3b4b1e:f762a35f6b:-7f70'/>
+              </UML:StructuralFeature.type>
+            </UML:Attribute>
+            <UML:Operation xmi.id = '19e11a1:f7837163c4:-7ffb' name = 'magic' visibility = 'public'
+              isSpecification = 'false' ownerScope = 'instance' isQuery = 'false' concurrency = 'sequential'
+              isRoot = 'false' isLeaf = 'false' isAbstract = 'false'>
+              <UML:BehavioralFeature.parameter>
+                <UML:Parameter xmi.id = '19e11a1:f7837163c4:-7ffa' name = 'arg1' isSpecification = 'false'
+                  kind = 'inout'/>
+                <UML:Parameter xmi.id = '19e11a1:f7837163c4:-7ff9' name = 'arg2' isSpecification = 'false'
+                  kind = 'inout'/>
+                <UML:Parameter xmi.id = '19e11a1:f7837163c4:-7ff8' name = 'return' isSpecification = 'false'
+                  kind = 'return'>
+                  <UML:Parameter.type>
+                    <UML:DataType xmi.idref = '3b4b1e:f762a35f6b:-7ff1'/>
+                  </UML:Parameter.type>
+                </UML:Parameter>
+              </UML:BehavioralFeature.parameter>
+            </UML:Operation>
+            <UML:Method xmi.id = '19e11a1:f7837163c4:-7ff7' isSpecification = 'false'
+              isQuery = 'false'>
+              <UML:Method.body>
+                <UML:ProcedureExpression xmi.id = '19e11a1:f7837163c4:-7ff6' language = 'java'
+                  body = ''/>
+              </UML:Method.body>
+              <UML:Method.specification>
+                <UML:Operation xmi.idref = '19e11a1:f7837163c4:-7ffb'/>
+              </UML:Method.specification>
+            </UML:Method>
+          </UML:Classifier.feature>
+        </UML:Class>
+        <UML:Package xmi.id = '3b4b1e:f762a35f6b:-7ff3' name = 'java' isSpecification = 'false'
+          isRoot = 'false' isLeaf = 'false' isAbstract = 'false'>
+          <UML:Namespace.ownedElement>
+            <UML:Package xmi.id = '3b4b1e:f762a35f6b:-7ff2' name = 'lang' isSpecification = 'false'
+              isRoot = 'false' isLeaf = 'false' isAbstract = 'false'>
+              <UML:Namespace.ownedElement>
+                <UML:DataType xmi.id = '3b4b1e:f762a35f6b:-7ff5' name = 'int' isSpecification = 'false'
+                  isRoot = 'false' isLeaf = 'false' isAbstract = 'false'/>
+                <UML:DataType xmi.id = '3b4b1e:f762a35f6b:-7ff1' name = 'void' isSpecification = 'false'
+                  isRoot = 'false' isLeaf = 'false' isAbstract = 'false'/>
+                <UML:DataType xmi.id = '3b4b1e:f762a35f6b:-7fb8' name = 'char' isSpecification = 'false'
+                  isRoot = 'false' isLeaf = 'false' isAbstract = 'false'/>
+              </UML:Namespace.ownedElement>
+            </UML:Package>
+          </UML:Namespace.ownedElement>
+        </UML:Package>
+        <UML:Stereotype xmi.id = '3b4b1e:f762a35f6b:-7fb4' name = 'entity' isSpecification = 'false'
+          isRoot = 'false' isLeaf = 'false' isAbstract = 'false'>
+          <UML:Stereotype.baseClass>Class</UML:Stereotype.baseClass>
+        </UML:Stereotype>
+        <UML:Stereotype xmi.id = '3b4b1e:f762a35f6b:-7fb6' name = 'Table' visibility = 'public'
+          isSpecification = 'false' isRoot = 'false' isLeaf = 'false' isAbstract = 'false'>
+          <UML:Stereotype.baseClass>Class</UML:Stereotype.baseClass>
+        </UML:Stereotype>
+        <UML:Class xmi.id = '3b4b1e:f762a35f6b:-7fa8' name = 'NotMe' visibility = 'public'
+          isSpecification = 'false' isRoot = 'false' isLeaf = 'false' isAbstract = 'false'
+          isActive = 'false'>
+          <UML:ModelElement.taggedValue>
+            <UML:TaggedValue xmi.id = '3b4b1e:f762a35f6b:-7fa7' isSpecification = 'false'>
               <UML:TaggedValue.dataValue>&lt;p&gt;
 No &amp;lt;&amp;lt;Table&amp;gt;&amp;gt; so the parser should ignore it.
 &lt;/p&gt;
-</UML:TaggedValue.dataValue>\r
-              <UML:TaggedValue.type>\r
-                <UML:TagDefinition xmi.idref = '3b4b1e:f762a35f6b:-7fa6'/>\r
-              </UML:TaggedValue.type>\r
-            </UML:TaggedValue>\r
-          </UML:ModelElement.taggedValue>\r
-        </UML:Class>\r
-        <UML:Class xmi.id = '3b4b1e:f762a35f6b:-7f90' name = 'PrivateFoo' visibility = 'private'\r
-          isSpecification = 'false' isRoot = 'false' isLeaf = 'false' isAbstract = 'false'\r
-          isActive = 'false'>\r
-          <UML:ModelElement.stereotype>\r
-            <UML:Stereotype xmi.idref = '3b4b1e:f762a35f6b:-7fb6'/>\r
-          </UML:ModelElement.stereotype>\r
-        </UML:Class>\r
-        <UML:Class xmi.id = '3b4b1e:f762a35f6b:-7f73' name = 'Recording' visibility = 'public'\r
-          isSpecification = 'false' isRoot = 'false' isLeaf = 'false' isAbstract = 'false'\r
-          isActive = 'false'>\r
-          <UML:ModelElement.stereotype>\r
-            <UML:Stereotype xmi.idref = '3b4b1e:f762a35f6b:-7fb6'/>\r
-          </UML:ModelElement.stereotype>\r
-          <UML:Classifier.feature>\r
-            <UML:Attribute xmi.id = '3b4b1e:f762a35f6b:-7f72' name = 'recordingid' visibility = 'public'\r
-              isSpecification = 'false' ownerScope = 'instance'>\r
-              <UML:ModelElement.stereotype>\r
-                <UML:Stereotype xmi.idref = '3b4b1e:f762a35f6b:-7ec8'/>\r
-              </UML:ModelElement.stereotype>\r
-              <UML:StructuralFeature.type>\r
-                <UML:DataType xmi.idref = '3b4b1e:f762a35f6b:-7ff5'/>\r
-              </UML:StructuralFeature.type>\r
-            </UML:Attribute>\r
-            <UML:Attribute xmi.id = '3b4b1e:f762a35f6b:-7f71' name = 'title' visibility = 'public'\r
-              isSpecification = 'false' ownerScope = 'instance'>\r
-              <UML:StructuralFeature.type>\r
-                <UML:DataType xmi.idref = '3b4b1e:f762a35f6b:-7f70'/>\r
-              </UML:StructuralFeature.type>\r
-            </UML:Attribute>\r
-            <UML:Attribute xmi.id = '3b4b1e:f762a35f6b:-7f3f' name = 'type' visibility = 'public'\r
-              isSpecification = 'false' ownerScope = 'instance'>\r
-              <UML:StructuralFeature.type>\r
-                <UML:DataType xmi.idref = '3b4b1e:f762a35f6b:-7f70'/>\r
-              </UML:StructuralFeature.type>\r
-            </UML:Attribute>\r
-          </UML:Classifier.feature>\r
-        </UML:Class>\r
-        <UML:DataType xmi.id = '3b4b1e:f762a35f6b:-7f70' name = 'varchar' visibility = 'public'\r
-          isSpecification = 'false' isRoot = 'false' isLeaf = 'false' isAbstract = 'false'/>\r
-        <UML:Class xmi.id = '3b4b1e:f762a35f6b:-7f3e' name = 'CD' visibility = 'public'\r
-          isSpecification = 'false' isRoot = 'false' isLeaf = 'false' isAbstract = 'false'\r
-          isActive = 'false'>\r
-          <UML:GeneralizableElement.generalization>\r
-            <UML:Generalization xmi.idref = '3b4b1e:f762a35f6b:-7f3d'/>\r
-          </UML:GeneralizableElement.generalization>\r
-        </UML:Class>\r
-        <UML:Generalization xmi.id = '3b4b1e:f762a35f6b:-7f3d' isSpecification = 'false'>\r
-          <UML:Generalization.child>\r
-            <UML:Class xmi.idref = '3b4b1e:f762a35f6b:-7f3e'/>\r
-          </UML:Generalization.child>\r
-          <UML:Generalization.parent>\r
-            <UML:Class xmi.idref = '3b4b1e:f762a35f6b:-7f73'/>\r
-          </UML:Generalization.parent>\r
-        </UML:Generalization>\r
-        <UML:Class xmi.id = '3b4b1e:f762a35f6b:-7f3c' name = 'Track' visibility = 'public'\r
-          isSpecification = 'false' isRoot = 'false' isLeaf = 'false' isAbstract = 'false'\r
-          isActive = 'false'>\r
-          <UML:ModelElement.stereotype>\r
-            <UML:Stereotype xmi.idref = '3b4b1e:f762a35f6b:-7fb6'/>\r
-          </UML:ModelElement.stereotype>\r
-          <UML:Classifier.feature>\r
-            <UML:Attribute xmi.id = '3b4b1e:f762a35f6b:-7e94' name = 'trackid' visibility = 'public'\r
-              isSpecification = 'false' ownerScope = 'instance'>\r
-              <UML:ModelElement.stereotype>\r
-                <UML:Stereotype xmi.idref = '3b4b1e:f762a35f6b:-7ec8'/>\r
-              </UML:ModelElement.stereotype>\r
-              <UML:StructuralFeature.type>\r
-                <UML:DataType xmi.idref = '3b4b1e:f762a35f6b:-7ff5'/>\r
-              </UML:StructuralFeature.type>\r
-            </UML:Attribute>\r
-            <UML:Attribute xmi.id = '3b4b1e:f762a35f6b:-7e7b' name = 'recordingid' visibility = 'public'\r
-              isSpecification = 'false' ownerScope = 'instance'>\r
-              <UML:ModelElement.stereotype>\r
-                <UML:Stereotype xmi.idref = '3b4b1e:f762a35f6b:-7ec7'/>\r
-              </UML:ModelElement.stereotype>\r
-              <UML:StructuralFeature.type>\r
-                <UML:DataType xmi.idref = '3b4b1e:f762a35f6b:-7ff5'/>\r
-              </UML:StructuralFeature.type>\r
-            </UML:Attribute>\r
-            <UML:Attribute xmi.id = '3b4b1e:f762a35f6b:-7f3b' name = 'number' visibility = 'public'\r
-              isSpecification = 'false' ownerScope = 'instance'>\r
-              <UML:Attribute.initialValue>\r
-                <UML:Expression xmi.id = '3b4b1e:f762a35f6b:-7e5b' language = 'java' body = '1'/>\r
-              </UML:Attribute.initialValue>\r
-              <UML:StructuralFeature.type>\r
-                <UML:DataType xmi.idref = '3b4b1e:f762a35f6b:-7ff5'/>\r
-              </UML:StructuralFeature.type>\r
-            </UML:Attribute>\r
-            <UML:Attribute xmi.id = '3b4b1e:f762a35f6b:-7f3a' name = 'name' visibility = 'public'\r
-              isSpecification = 'false' ownerScope = 'instance'>\r
-              <UML:StructuralFeature.type>\r
-                <UML:DataType xmi.idref = '3b4b1e:f762a35f6b:-7f70'/>\r
-              </UML:StructuralFeature.type>\r
-            </UML:Attribute>\r
-          </UML:Classifier.feature>\r
-        </UML:Class>\r
-        <UML:Association xmi.id = '3b4b1e:f762a35f6b:-7f39' isSpecification = 'false'\r
-          isRoot = 'false' isLeaf = 'false' isAbstract = 'false'>\r
-          <UML:Association.connection>\r
-            <UML:AssociationEnd xmi.id = '3b4b1e:f762a35f6b:-7f38' visibility = 'public'\r
-              isSpecification = 'false' isNavigable = 'false' ordering = 'unordered' aggregation = 'composite'\r
-              targetScope = 'instance' changeability = 'changeable'>\r
-              <UML:AssociationEnd.multiplicity>\r
-                <UML:Multiplicity xmi.id = '3b4b1e:f762a35f6b:-7f37'>\r
-                  <UML:Multiplicity.range>\r
-                    <UML:MultiplicityRange xmi.id = '3b4b1e:f762a35f6b:-7f36' lower = '1' upper = '1'/>\r
-                  </UML:Multiplicity.range>\r
-                </UML:Multiplicity>\r
-              </UML:AssociationEnd.multiplicity>\r
-              <UML:AssociationEnd.participant>\r
-                <UML:Class xmi.idref = '3b4b1e:f762a35f6b:-7f73'/>\r
-              </UML:AssociationEnd.participant>\r
-            </UML:AssociationEnd>\r
-            <UML:AssociationEnd xmi.id = '3b4b1e:f762a35f6b:-7f35' name = '' visibility = 'public'\r
-              isSpecification = 'false' isNavigable = 'true' ordering = 'unordered' aggregation = 'none'\r
-              targetScope = 'instance' changeability = 'changeable'>\r
-              <UML:AssociationEnd.multiplicity>\r
-                <UML:Multiplicity xmi.id = '3b4b1e:f762a35f6b:-7f34'>\r
-                  <UML:Multiplicity.range>\r
-                    <UML:MultiplicityRange xmi.id = '3b4b1e:f762a35f6b:-7f33' lower = '1' upper = '-1'/>\r
-                  </UML:Multiplicity.range>\r
-                </UML:Multiplicity>\r
-              </UML:AssociationEnd.multiplicity>\r
-              <UML:AssociationEnd.participant>\r
-                <UML:Class xmi.idref = '3b4b1e:f762a35f6b:-7f3c'/>\r
-              </UML:AssociationEnd.participant>\r
-            </UML:AssociationEnd>\r
-          </UML:Association.connection>\r
-        </UML:Association>\r
-        <UML:Stereotype xmi.id = '3b4b1e:f762a35f6b:-7ec8' name = 'PK' visibility = 'public'\r
-          isSpecification = 'false' isRoot = 'false' isLeaf = 'false' isAbstract = 'false'>\r
-          <UML:Stereotype.baseClass>Attribute</UML:Stereotype.baseClass>\r
-        </UML:Stereotype>\r
-        <UML:Stereotype xmi.id = '3b4b1e:f762a35f6b:-7ec7' name = 'FK' visibility = 'public'\r
-          isSpecification = 'false' isRoot = 'false' isLeaf = 'false' isAbstract = 'false'>\r
-          <UML:Stereotype.baseClass>Attribute</UML:Stereotype.baseClass>\r
-        </UML:Stereotype>\r
-        <UML:Class xmi.id = '3b4b1e:f762a35f6b:-7e54' name = 'ProtectedFoo' visibility = 'protected'\r
-          isSpecification = 'false' isRoot = 'false' isLeaf = 'false' isAbstract = 'false'\r
-          isActive = 'false'>\r
-          <UML:ModelElement.stereotype>\r
-            <UML:Stereotype xmi.idref = '3b4b1e:f762a35f6b:-7fb6'/>\r
-          </UML:ModelElement.stereotype>\r
-        </UML:Class>\r
-      </UML:Namespace.ownedElement>\r
-    </UML:Model>\r
-    <UML:TagDefinition xmi.id = '3b4b1e:f762a35f6b:-7fa6' name = 'documentation'\r
-      isSpecification = 'false' tagType = 'String'>\r
-      <UML:TagDefinition.multiplicity>\r
-        <UML:Multiplicity xmi.id = '3b4b1e:f762a35f6b:-7fa5'>\r
-          <UML:Multiplicity.range>\r
-            <UML:MultiplicityRange xmi.id = '3b4b1e:f762a35f6b:-7fa4' lower = '1' upper = '1'/>\r
-          </UML:Multiplicity.range>\r
-        </UML:Multiplicity>\r
-      </UML:TagDefinition.multiplicity>\r
-    </UML:TagDefinition>\r
-    <UML:Uml1SemanticModelBridge xmi.id = '3b4b1e:f762a35f6b:-7fc0' presentation = ''>\r
-      <UML:Uml1SemanticModelBridge.element>\r
-        <UML:Model xmi.idref = '3b4b1e:f762a35f6b:-7ff9'/>\r
-      </UML:Uml1SemanticModelBridge.element>\r
-    </UML:Uml1SemanticModelBridge>\r
-  </XMI.content>\r
-</XMI>\r
+</UML:TaggedValue.dataValue>
+              <UML:TaggedValue.type>
+                <UML:TagDefinition xmi.idref = '3b4b1e:f762a35f6b:-7fa6'/>
+              </UML:TaggedValue.type>
+            </UML:TaggedValue>
+          </UML:ModelElement.taggedValue>
+        </UML:Class>
+        <UML:Class xmi.id = '3b4b1e:f762a35f6b:-7f90' name = 'PrivateFoo' visibility = 'private'
+          isSpecification = 'false' isRoot = 'false' isLeaf = 'false' isAbstract = 'false'
+          isActive = 'false'>
+          <UML:ModelElement.stereotype>
+            <UML:Stereotype xmi.idref = '3b4b1e:f762a35f6b:-7fb6'/>
+          </UML:ModelElement.stereotype>
+        </UML:Class>
+        <UML:Class xmi.id = '3b4b1e:f762a35f6b:-7f73' name = 'Recording' visibility = 'public'
+          isSpecification = 'false' isRoot = 'false' isLeaf = 'false' isAbstract = 'false'
+          isActive = 'false'>
+          <UML:ModelElement.stereotype>
+            <UML:Stereotype xmi.idref = '3b4b1e:f762a35f6b:-7fb6'/>
+          </UML:ModelElement.stereotype>
+          <UML:Classifier.feature>
+            <UML:Attribute xmi.id = '3b4b1e:f762a35f6b:-7f72' name = 'recordingid' visibility = 'public'
+              isSpecification = 'false' ownerScope = 'instance'>
+              <UML:ModelElement.stereotype>
+                <UML:Stereotype xmi.idref = '3b4b1e:f762a35f6b:-7ec8'/>
+              </UML:ModelElement.stereotype>
+              <UML:StructuralFeature.type>
+                <UML:DataType xmi.idref = '3b4b1e:f762a35f6b:-7ff5'/>
+              </UML:StructuralFeature.type>
+            </UML:Attribute>
+            <UML:Attribute xmi.id = '3b4b1e:f762a35f6b:-7f71' name = 'title' visibility = 'public'
+              isSpecification = 'false' ownerScope = 'instance'>
+              <UML:StructuralFeature.type>
+                <UML:DataType xmi.idref = '3b4b1e:f762a35f6b:-7f70'/>
+              </UML:StructuralFeature.type>
+            </UML:Attribute>
+            <UML:Attribute xmi.id = '3b4b1e:f762a35f6b:-7f3f' name = 'type' visibility = 'public'
+              isSpecification = 'false' ownerScope = 'instance'>
+              <UML:StructuralFeature.type>
+                <UML:DataType xmi.idref = '3b4b1e:f762a35f6b:-7f70'/>
+              </UML:StructuralFeature.type>
+            </UML:Attribute>
+          </UML:Classifier.feature>
+        </UML:Class>
+        <UML:DataType xmi.id = '3b4b1e:f762a35f6b:-7f70' name = 'varchar' visibility = 'public'
+          isSpecification = 'false' isRoot = 'false' isLeaf = 'false' isAbstract = 'false'/>
+        <UML:Class xmi.id = '3b4b1e:f762a35f6b:-7f3e' name = 'CD' visibility = 'public'
+          isSpecification = 'false' isRoot = 'false' isLeaf = 'false' isAbstract = 'false'
+          isActive = 'false'>
+          <UML:GeneralizableElement.generalization>
+            <UML:Generalization xmi.idref = '3b4b1e:f762a35f6b:-7f3d'/>
+          </UML:GeneralizableElement.generalization>
+        </UML:Class>
+        <UML:Generalization xmi.id = '3b4b1e:f762a35f6b:-7f3d' isSpecification = 'false'>
+          <UML:Generalization.child>
+            <UML:Class xmi.idref = '3b4b1e:f762a35f6b:-7f3e'/>
+          </UML:Generalization.child>
+          <UML:Generalization.parent>
+            <UML:Class xmi.idref = '3b4b1e:f762a35f6b:-7f73'/>
+          </UML:Generalization.parent>
+        </UML:Generalization>
+        <UML:Class xmi.id = '3b4b1e:f762a35f6b:-7f3c' name = 'Track' visibility = 'public'
+          isSpecification = 'false' isRoot = 'false' isLeaf = 'false' isAbstract = 'false'
+          isActive = 'false'>
+          <UML:ModelElement.stereotype>
+            <UML:Stereotype xmi.idref = '3b4b1e:f762a35f6b:-7fb6'/>
+          </UML:ModelElement.stereotype>
+          <UML:Classifier.feature>
+            <UML:Attribute xmi.id = '3b4b1e:f762a35f6b:-7e94' name = 'trackid' visibility = 'public'
+              isSpecification = 'false' ownerScope = 'instance'>
+              <UML:ModelElement.stereotype>
+                <UML:Stereotype xmi.idref = '3b4b1e:f762a35f6b:-7ec8'/>
+              </UML:ModelElement.stereotype>
+              <UML:StructuralFeature.type>
+                <UML:DataType xmi.idref = '3b4b1e:f762a35f6b:-7ff5'/>
+              </UML:StructuralFeature.type>
+            </UML:Attribute>
+            <UML:Attribute xmi.id = '3b4b1e:f762a35f6b:-7e7b' name = 'recordingid' visibility = 'public'
+              isSpecification = 'false' ownerScope = 'instance'>
+              <UML:ModelElement.stereotype>
+                <UML:Stereotype xmi.idref = '3b4b1e:f762a35f6b:-7ec7'/>
+              </UML:ModelElement.stereotype>
+              <UML:StructuralFeature.type>
+                <UML:DataType xmi.idref = '3b4b1e:f762a35f6b:-7ff5'/>
+              </UML:StructuralFeature.type>
+            </UML:Attribute>
+            <UML:Attribute xmi.id = '3b4b1e:f762a35f6b:-7f3b' name = 'number' visibility = 'public'
+              isSpecification = 'false' ownerScope = 'instance'>
+              <UML:Attribute.initialValue>
+                <UML:Expression xmi.id = '3b4b1e:f762a35f6b:-7e5b' language = 'java' body = '1'/>
+              </UML:Attribute.initialValue>
+              <UML:StructuralFeature.type>
+                <UML:DataType xmi.idref = '3b4b1e:f762a35f6b:-7ff5'/>
+              </UML:StructuralFeature.type>
+            </UML:Attribute>
+            <UML:Attribute xmi.id = '3b4b1e:f762a35f6b:-7f3a' name = 'name' visibility = 'public'
+              isSpecification = 'false' ownerScope = 'instance'>
+              <UML:StructuralFeature.type>
+                <UML:DataType xmi.idref = '3b4b1e:f762a35f6b:-7f70'/>
+              </UML:StructuralFeature.type>
+            </UML:Attribute>
+          </UML:Classifier.feature>
+        </UML:Class>
+        <UML:Association xmi.id = '3b4b1e:f762a35f6b:-7f39' isSpecification = 'false'
+          isRoot = 'false' isLeaf = 'false' isAbstract = 'false'>
+          <UML:Association.connection>
+            <UML:AssociationEnd xmi.id = '3b4b1e:f762a35f6b:-7f38' visibility = 'public'
+              isSpecification = 'false' isNavigable = 'false' ordering = 'unordered' aggregation = 'composite'
+              targetScope = 'instance' changeability = 'changeable'>
+              <UML:AssociationEnd.multiplicity>
+                <UML:Multiplicity xmi.id = '3b4b1e:f762a35f6b:-7f37'>
+                  <UML:Multiplicity.range>
+                    <UML:MultiplicityRange xmi.id = '3b4b1e:f762a35f6b:-7f36' lower = '1' upper = '1'/>
+                  </UML:Multiplicity.range>
+                </UML:Multiplicity>
+              </UML:AssociationEnd.multiplicity>
+              <UML:AssociationEnd.participant>
+                <UML:Class xmi.idref = '3b4b1e:f762a35f6b:-7f73'/>
+              </UML:AssociationEnd.participant>
+            </UML:AssociationEnd>
+            <UML:AssociationEnd xmi.id = '3b4b1e:f762a35f6b:-7f35' name = '' visibility = 'public'
+              isSpecification = 'false' isNavigable = 'true' ordering = 'unordered' aggregation = 'none'
+              targetScope = 'instance' changeability = 'changeable'>
+              <UML:AssociationEnd.multiplicity>
+                <UML:Multiplicity xmi.id = '3b4b1e:f762a35f6b:-7f34'>
+                  <UML:Multiplicity.range>
+                    <UML:MultiplicityRange xmi.id = '3b4b1e:f762a35f6b:-7f33' lower = '1' upper = '-1'/>
+                  </UML:Multiplicity.range>
+                </UML:Multiplicity>
+              </UML:AssociationEnd.multiplicity>
+              <UML:AssociationEnd.participant>
+                <UML:Class xmi.idref = '3b4b1e:f762a35f6b:-7f3c'/>
+              </UML:AssociationEnd.participant>
+            </UML:AssociationEnd>
+          </UML:Association.connection>
+        </UML:Association>
+        <UML:Stereotype xmi.id = '3b4b1e:f762a35f6b:-7ec8' name = 'PK' visibility = 'public'
+          isSpecification = 'false' isRoot = 'false' isLeaf = 'false' isAbstract = 'false'>
+          <UML:Stereotype.baseClass>Attribute</UML:Stereotype.baseClass>
+        </UML:Stereotype>
+        <UML:Stereotype xmi.id = '3b4b1e:f762a35f6b:-7ec7' name = 'FK' visibility = 'public'
+          isSpecification = 'false' isRoot = 'false' isLeaf = 'false' isAbstract = 'false'>
+          <UML:Stereotype.baseClass>Attribute</UML:Stereotype.baseClass>
+        </UML:Stereotype>
+        <UML:Class xmi.id = '3b4b1e:f762a35f6b:-7e54' name = 'ProtectedFoo' visibility = 'protected'
+          isSpecification = 'false' isRoot = 'false' isLeaf = 'false' isAbstract = 'false'
+          isActive = 'false'>
+          <UML:ModelElement.stereotype>
+            <UML:Stereotype xmi.idref = '3b4b1e:f762a35f6b:-7fb6'/>
+          </UML:ModelElement.stereotype>
+        </UML:Class>
+        <UML:Class xmi.id = '19e11a1:f7837163c4:-7ff5' name = 'arg1' visibility = 'public'
+          isSpecification = 'false' isRoot = 'false' isLeaf = 'false' isAbstract = 'false'
+          isActive = 'false'/>
+        <UML:Class xmi.id = '19e11a1:f7837163c4:-7ff4' name = 'arg2' visibility = 'public'
+          isSpecification = 'false' isRoot = 'false' isLeaf = 'false' isAbstract = 'false'
+          isActive = 'false'/>
+      </UML:Namespace.ownedElement>
+    </UML:Model>
+    <UML:TagDefinition xmi.id = '3b4b1e:f762a35f6b:-7fa6' name = 'documentation'
+      isSpecification = 'false' tagType = 'String'>
+      <UML:TagDefinition.multiplicity>
+        <UML:Multiplicity xmi.id = '3b4b1e:f762a35f6b:-7fa5'>
+          <UML:Multiplicity.range>
+            <UML:MultiplicityRange xmi.id = '3b4b1e:f762a35f6b:-7fa4' lower = '1' upper = '1'/>
+          </UML:Multiplicity.range>
+        </UML:Multiplicity>
+      </UML:TagDefinition.multiplicity>
+    </UML:TagDefinition>
+    <UML:Uml1SemanticModelBridge xmi.id = '3b4b1e:f762a35f6b:-7fc0' presentation = ''>
+      <UML:Uml1SemanticModelBridge.element>
+        <UML:Model xmi.idref = '3b4b1e:f762a35f6b:-7ff9'/>
+      </UML:Uml1SemanticModelBridge.element>
+    </UML:Uml1SemanticModelBridge>
+  </XMI.content>
+</XMI>
index 3431cbc..facaf44 100644 (file)
Binary files a/t/data/xmi/Foo.poseidon2.zuml and b/t/data/xmi/Foo.poseidon2.zuml differ