Book a Demo

Author Topic: XML Schema generation  (Read 2941 times)

ukj

  • EA Novice
  • *
  • Posts: 1
  • Karma: +0/-0
    • View Profile
XML Schema generation
« on: September 29, 2003, 05:09:46 pm »
I have created a UML Logical Model and want to generate an XML Schema from it. I understand that I am supposed to select a package and then select 'Generate XML Schema...'. That works fine.

What I don't understand is how to tie my own created custom (Configuration -> 'Languages Datatypes') data types to XML Schema Datatypes. I have read that I am supposed to have done the following:


XSDDataTypes Package: This package contains classes representing XSD primitive data types
UML Profile for XML: This resource file contains the stereotyped classes which allow the schema generation to be customized.

But I don't understand how to connect all of this together. For example, where do I tell the 'Generate XML Schema...' engine that my 'Unit' data type is really an xs:long and not an xs:string as it is defaulted to during the generation of the XML Schema Datatypes?

Thanks in advance

Sincerely,
/Kenneth

benc

  • EA Administrator
  • EA User
  • *****
  • Posts: 200
  • Karma: +0/-0
    • View Profile
Re: XML Schema generation
« Reply #1 on: October 01, 2003, 05:33:26 pm »
Hi Kenneth,

The schema generator does not use the language datatypes when resolving the classifier types- so I don't think its possible to do what you're after.

Basically, when you specify a classifier for an attribute in your schema model, the generator attempts to find it in the model.  From there it grabs any relevant info (name, targetNamespace prefix etc.)  If it's not in the model, it tries to match it against a built-in primitive type.  If that fails, its defaults to string.

The XSDDatatypes package defines the primitive types so can model with them (specify them as classifiers, inherit from them etc.)

I'm trying to think of a work around for what you're after, based on inheriting from a built-in type or use of aliases, but I'm stuck.  Is it inconceivable to use one of the built-in types directly?  Still thinking ...

Regards,
Ben