Book a Demo

Author Topic: XSD Transformation creates all <XSDcomplexTypes>  (Read 5529 times)

Bcodms

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
XSD Transformation creates all <XSDcomplexTypes>
« on: April 27, 2011, 07:03:29 am »
Using "Transform current package" of a folder resulted in a schema package that had transformed <XSDsimpleTypes> into <XSDcomplexTypes>. The stereotype information was not read upon conversion and apparently defautled to <XSDcomplexTypes>.  Specfically, we made a xs:integer restricted type with minInclusive and maxInclusive restrictions. Upon transformation all of this information was lost.

Anyone seen this problem before?

Version 8.0.864

Bcodms

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Re: XSD Transformation creates all <XSDcomplexTypes>
« Reply #1 on: April 27, 2011, 07:52:34 am »
Why???? Why hardcode the transformation. Why doesn't Sparx make a script that applies to all sterotypes?

My associate found the transformation package scripts:

 

%if elemType != "Class"%
%endTemplate%

 Class
{
  name=%qt%%className%%qt%
%if classStereotype=="enumeration"%
  stereotype="enumeration"
%else%
 stereotype="XSDcomplexType"
%endIf%
  %TRANSFORM_CURRENT("name","stereotype")%
  %TRANSFORM_REFERENCE("XSDClass")%
%if elemType=="Class"%
%list="Attribute" @separator="\n" @indent="  "%
%endIf%
}


%list="Connector" @separator="\n" @indent="  "%


Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: XSD Transformation creates all <XSDcomplexTypes>
« Reply #2 on: April 27, 2011, 09:08:55 am »
Because the script is not expecting you to transform from an XSD model to another XSD model. It's expecting a platform independent model.

What are you trying to achieve by running the transformation?

Bcodms

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Re: XSD Transformation creates all <XSDcomplexTypes>
« Reply #3 on: April 27, 2011, 09:30:31 am »
Thanks for your response. I used a XSD Stereotyped class because a UML data class didn't produce the restricted simpleType that we need for the schema. How would you create a complexType with a sequence of restricted simpleTypes.  Like a restriction base = xs:integer with tagged values of minInclusive and maxInclusive or any other restricted type.  If you perform a transform from a UML data class with an attribute that needs to be a restricted type the transform doesn't bring over the restrictions (minInclusive/maxInclusive) either. So to try to model something that has the restrictions as a work around I tried to create a XSDsimpleType stereotype to work around the limitation of a UML data class.  I appreciate your response.

buddy robbins

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
Re: XSD Transformation creates all <XSDcomplexTypes>
« Reply #4 on: May 03, 2011, 02:58:10 am »
I got you going, dude.
You have to modify the transformation template.
That gives you the XSDSimple stereotype.
You'll also have to check all possible tag values in your source class and copy them to your transformed class.  Still working on setting the base type.