Reverse Engineering an XML Schema into an XSM

Reverse engineering is the process of extracting an XML structure from an XML schema file into an XSM. You can reverse engineer XML schema files to create a new XSM or to add objects to an existing XSM.

Note: PowerDesigner uses parser software developed by the Apache Software Foundation (http://www.apache.org) for XML reverse engineering.
  1. To reverse engineer a schema and create a new XSM, select File > Reverse Engineer > XML Definition to open the New XML Model dialog box. Specify a model name, choose an XML language from the list, and then click OK.
    Note: If your reverse-engineering will create multiple connected XSM models due to import and include statements, you may first want to create an empty project (File > New Project) and reverse-engineer your files into the project, which will act as a container for the files and allow you to check them into and out of the repository as a single unit.

    or

    To reverse engineer a schema into an existing XSM, open the model and select Language > Reverse Engineer schema File.

  2. When the Reverse Engineering dialog opens, select the file or enter the URL you want to reverse-engineer (which can be of any type accessible via a browser except for ftp), and select any appropriate options:

    Option

    Description

    Show symbols

    Creates symbols for the reversed objects in the diagram. You can specify to expand all the nodes, and to display elements, groups, and complex and simple types.

    Convert unique references to elements

    Transforms global objects that are referenced only once in the model into child objects. You can perform this conversion at any time by selecting Tools > Convert Unique References in the XML model.

  3. [XSD only] If the schema contains Import or Include elements, the schema files referenced are listed in a tree format in the dialog. Files not found display a red overlay. For each file in the tree (including those which are found), you can click on it to :
    • In the File or URL field, change the value to an appropriate local path or valid URL path.
    • In the File or URL field, browse to and select an XSM open in the workspace to stand in for the referenced file.


  4. When you have resolved all references and are satisfied, click OK to begin reverse engineering.

    If you are reverse engineering to an existing XSM, then the Merge Models dialog box opens to allow you to control the merging of the new objects into your XSM (see Core Features Guide > Modeling with PowerDesigner > Comparing and Merging Models).

    When the process is complete, a confirmation message is given in the Output window. The principal XML file is created, and a separate XSM is created for each file that is included or imported. Each import and include is created as an object in the appropriate model (see Instructions: Import, Include and Redefine (XSM)), and shortcuts are created to reference the elements, types, or other objects defined in the imported or included schemas.