Troubleshooting
Problem
Attempts to generate XML files from XSD files using the IBM Rational Software Architect context menu Generate > XML results in the error "No root element exists since the schema provided has no global elements.".
Symptom
The UML to XSD transform generates XML schema files from UML models.
Attempts to generate XML files from XSD files, using the context menu Generate > XML results in the error:
No root element exists since the schema provided has no global elements.
Steps to reproduce:
- Create a new UML Model
- Apply the XSD Profile:
2.1. Select the model
2.2. Look at the Properties->Profiles
2.3. Add profile... Select profile->Deployed profile->XSD Transformation
- If the above step is not possible, make sure to enable the Capabilities:
XSD Transformation profile
Web Service Developer
- Add a UML Package "Catalog" and apply the stereotype <<schema>> from XSDProfile
- Add a class Book to the package and apply the stereotype <<complexType>> from XSDprofile
- Add an attribute Author to the class and set the type as string (from XSD Data Types)
- Add an attribute Title to the class and set the type as string (from XSD Data Types)
- Save the model
- Create a new transformation configuration called MyTransform.tc:
8.1. Modeling->Tranform->New Configuration
8.2. Service Oriented Architecture->UML to XSD
8.3 Select the Model top-level package as source and the UML Project as target
- Run the transformation:
9.1. Right click on MyTransform.tc and choose
9.2. Transform->UML to XSD
- Open the generated file Catalog.xsd:
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsd_1="http://Catalog/" targetNamespace="http://Catalog/">
- Right click on schema and choose: Validate. There will be no error
- Right click on the file and choose Generate->XML File...
You will see the error:
No root element exists since the schema provided has no global elements
[{"Product":{"code":"SS4JCV","label":"Rational Software Architect for WebSphere Software"},"Business Unit":{"code":"BU053","label":"Cloud \u0026 Data Platform"},"Component":"Transformation","Platform":[{"code":"PF016","label":"Linux"},{"code":"PF033","label":"Windows"}],"Version":"7.5;7.5.1;7.5.2;7.5.3;7.5.4;7.5.5;7.5.5.1","Edition":"","Line of Business":{"code":"LOB15","label":"Integration"}},{"Product":{"code":"SSJP3D","label":"Rational Systems Developer"},"Business Unit":{"code":"BU053","label":"Cloud \u0026 Data Platform"},"Component":"Transformation","Platform":[{"code":"PF033","label":"Windows"}],"Version":"7.0;7.0.0.1;7.0.0.2;7.0.0.3;7.0.0.4;7.0.5;7.0.5.1;7.0.5.2","Edition":"All Editions","Line of Business":{"code":"LOB45","label":"Automation"}},{"Product":{"code":"SSYK2S","label":"Rational Software Architect Designer"},"Business Unit":{"code":"BU048","label":"IBM Software"},"Component":" ","Platform":[{"code":"PF016","label":"Linux"},{"code":"PF033","label":"Windows"}],"Version":"7.0;7.0.0.1;7.0.0.10;7.0.0.2;7.0.0.3;7.0.0.4;7.0.0.5;7.0.0.6;7.0.0.7;7.0.0.8;7.0.0.9","Edition":"","Line of Business":{"code":"LOB77","label":"Automation Platform"}}]
Log InLog in to view more of this document
This document has the abstract of a technical article that is available to authorized users once you have logged on. Please use Log in button above to access the full document. After log in, if you do not have the right authorization for this document, there will be instructions on what to do next.
Was this topic helpful?
Document Information
Modified date:
10 September 2020
UID
swg21273433