Book a Demo

Author Topic: Transform Package into XSD - Issue on camel case  (Read 4139 times)

cecD

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
Transform Package into XSD - Issue on camel case
« on: December 03, 2015, 09:01:37 pm »
I transform an UML Package into an XSD model with “Transform Package” functionality.
In the resulting XSD model, all the attributes that were in “camel case” in the UML class diagram are now in lower case.
Example:
attribute in UML Class: positionCode
corresponding attribute in XSD model: positioncode
Is it an issue ?
Do you know if there is a way to avoid this?
Thanks in advance

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Transform Package into XSD - Issue on camel ca
« Reply #1 on: December 03, 2015, 09:46:14 pm »
You can change the MDA template for XSD tranformation.

Go to Package|Model Transformation|MDA Transformation Templates then choose XSD from the dropdown
Then select the Attribute template and change
Code: [Select]
 %TRANSFORM_CURRENT("name","scope","type")%
  name=%qt%%CONVERT_NAME(attName,"Spaced", "Camel Case")%%qt%
into
Code: [Select]
 %TRANSFORM_CURRENT("scope","type")%

This will leave the attribute names untouched.

Geert

cecD

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
Re: Transform Package into XSD - Issue on camel ca
« Reply #2 on: December 04, 2015, 12:33:49 am »
Thanks!
It works fine.
I didn't know the 'Transformation Editor'....
Do you know if I can also use this function for the following subject:
A class (named "test") in UML --> XSDcomplexType "test" in XSD model.
After generation  of the xsd file (with option 'Generate global element for all global Complex Type'), I have one element "test" of type complexType "test".
I would like to have one element "test" of type complexType "testType".
With the Transformation Editor, maybe I could generate for a given UML class: one XSDTopLevelElement with the same name as the class and one XSDComplexType with name "classType"?
Many thanks


Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Transform Package into XSD - Issue on camel ca
« Reply #3 on: December 04, 2015, 01:50:33 am »
Seems like something that should be achievable with the transformation template.
But I wouldn't know right away how to.

Geert