package SQL::Translator::Parser::XML::XMI;
# -------------------------------------------------------------------
-# $Id: XMI.pm,v 1.9 2003-10-01 17:17:24 grommit Exp $
+# $Id: XMI.pm,v 1.10 2003-10-03 13:17:28 grommit Exp $
# -------------------------------------------------------------------
# Copyright (C) 2003 Mark Addison <mark.addison@itn.co.uk>,
#
use strict;
use vars qw[ $DEBUG $VERSION @EXPORT_OK ];
-$VERSION = sprintf "%d.%02d", q$Revision: 1.9 $ =~ /(\d+)\.(\d+)/;
+$VERSION = sprintf "%d.%02d", q$Revision: 1.10 $ =~ /(\d+)\.(\d+)/;
$DEBUG = 0 unless defined $DEBUG;
use Data::Dumper;
$data{default_value} = $attr->{initialValue}
if exists $attr->{initialValue};
$data{data_type} = $attr->{_map_taggedValues}{dataType}{dataValue}
- || $attr->{datatype};
+ || $attr->{dataType}{name};
$data{size} = $attr->{_map_taggedValues}{size}{dataValue};
$data{is_nullable}=$attr->{_map_taggedValues}{nullable}{dataValue};
package SQL::Translator::XMI::Parser::V12;
# -------------------------------------------------------------------
-# $Id: V12.pm,v 1.2 2003-10-01 17:45:47 grommit Exp $
+# $Id: V12.pm,v 1.3 2003-10-03 13:17:28 grommit Exp $
# -------------------------------------------------------------------
# Copyright (C) 2003 Mark Addison <mark.addison@itn.co.uk>,
#
use strict;
use 5.006_001;
use vars qw/$VERSION/;
-$VERSION = sprintf "%d.%02d", q$Revision: 1.2 $ =~ /(\d+)\.(\d+)/;
+$VERSION = sprintf "%d.%02d", q$Revision: 1.3 $ =~ /(\d+)\.(\d+)/;
use base qw(SQL::Translator::XMI::Parser);
default => "",
},
{
- name => "datatype",
- path => 'xmiDeref(UML:StructuralFeature.type/UML:DataType)/@name',
- },
- {
name => "initialValue",
path => 'UML:Attribute.initialValue/UML:Expression/@body',
},
multiplicity => "*",
map => "name",
},
+ {
+ name => "dataType",
+ path => 'xmiDeref(UML:StructuralFeature.type/UML:DataType)',
+ class => "dataType",
+ multiplicity => "1",
+ },
+ ],
+};
+
+$spec12->{dataType} = {
+ name => "datatype",
+ plural => "datatypes",
+ default_path => '//UML:DataType[@xmi.id]',
+ attrib_data =>
+ [qw/name visibility isSpecification isRoot isLeaf isAbstract/],
+ path_data => [
+ {
+ name => "stereotype",
+ path => 'xmiDeref(UML:ModelElement.stereotype/UML:Stereotype)/@name',
+ default => "",
+ },
],
};
+
+
$spec12->{operation} = {
name => "operation",
plural => "operations",