XSD Schema to Java

General discussions about code engineering

Moderator: Moderators

XSD Schema to Java

Postby kenneth.f.hicks@lmco.com » Tue Aug 07, 2018 12:02 pm

I have XSD schemas that I can successfully reverse. I am wanting to get Java classes generated based on the class definitions from the XSD. Is this possible in Cameo Enterprise Architect? To use different words, can Cameo be used to translate from an XSD schema to another coding language like Java or C#? Reverse in the XSD then assign the resulting classes to another Engineering Set for Java and generate? Or, will the syntax be so different that it won't work?
kenneth.f.hicks@lmco.com
Forum Newbie
Forum Newbie
 
Posts: 3
Posts Rating:0
Joined: Mon Jul 16, 2018 10:36 am
Full name: Ken

Re: XSD Schema to Java

Postby gedkvi » Tue Aug 14, 2018 1:13 am

Hello,

To use different words, can Cameo be used to translate from an XSD schema to another coding language like Java or C#?

You could use the reversed XSD to transform it to a simple UML and them generate Java classes from it.

Here are the steps you should do:
1) Reverse your XSD
2) Create a new package to store the future result
3) Go to Tools -> Model Transformations and select XML Schema to UML.
4) In that wizard select the XSD elements to be transformed to UML elements. Select the package created earlier as the Transformation Destination. Continue with the wizard.
5) Create a new Java Code Engineering Set goto Edit and Add Data From Model tab. Select the classes you wish to be generated. (Note: do not add the transformation information package itself, called "XML Schema to UML". There are no generatable Java elements there.)
6) Generate the Java code.

If you wish to continue developing on that UML model, you can later use the Java_SE_8 profile for Java specific datatypes.

Sincerely,
No Magic Customer Support
gedkvi
Customer Support
Customer Support
 
Posts: 55
Posts Rating:7
Joined: Wed Sep 16, 2015 11:25 am

Re: XSD Schema to Java

Postby kenneth.f.hicks@lmco.com » Tue Aug 14, 2018 8:40 am

Thank you for the reply. I will give your instructions a try. I will right a follow up reply with the results.
kenneth.f.hicks@lmco.com
Forum Newbie
Forum Newbie
 
Posts: 3
Posts Rating:0
Joined: Mon Jul 16, 2018 10:36 am
Full name: Ken


Return to Code engineering

Who is online

Users browsing this forum: No registered users and 0 guests