XML Imports (Profile)

XML imports allow you to define mappings between an XML schema and the PowerDesigner metamodel (and any extensions) to enable the import of XML files complying with the schema. You can specify initialization and post-processing scripts to manage complexities in the import.

For an overview of creating, deploying, and using XML imports, see Core Features Guide > Modeling with PowerDesigner > Objects > Importing Objects from XML Files.
  1. [if the XML Imports category is not present] Right-click the root node, select Add Items, select XML Imports, and click OK to create this folder.
  2. Right click the XML Imports folder, and select New to create an XML import.
  3. Enter the following properties as appropriate:

    Property

    Description

    Name Specifies the name of the import, which will be used as the name of the import command under File > Import.
    First diagram Specifies the first diagram that should be initialized in the model created from the imported file.
    Create default symbols Specifies to create symbols for the imported objects in the diagram.
    File extension Specifies the file extension that identifies XML documents that conform to the schema.

    Comment

    Provides an explanation of the import or other additional information.

  4. Click the Schema tab and click the Import tool to copy the schema, with any imports and includes resolved, to the extension file for mapping.
    Warning!  If the selected schema is too permissive and allows for too many possible object hierarchies it may not be possible to display it fully in the Mapping Editor. If you have an example XML data file to import, you can import this in place of the schema by clicking the Import from Sample tool and PowerDesigner will deduce a partial schema from it. Note that while a schema obtained in this way may successfully import the sample data file, other documents based on the same schema may not be complete if they contain other types of objects (or attributes or collections) that, though valid for the schema, were not in the first document.
    You can click the View as Model tool to open the schema as an XML schema model.
  5. [optional] Click the Extensions tab and select extension files containing extensions to the standard PowerDesigner metamodel to provide additional metaclasses (see Extended Objects, Sub-Objects, and Links (Profile)), attributes (see Extended Attributes (Profile)), and collections (see Extended Collections and Compositions (Profile)) to map your XML schema to.
    Attaching extension files in this way allow you to reuse previously defined extensions in your imports or to share extensions between imports. You can also define extensions under the Profile category in the resource file containing the XML import definition, or create them dynamically when creating your import mappings.
  6. [optional] Click the Initialization tab and enter VBScript to run at model creation time before the importing of any objects. You can access shared library functions and static attributes defined for reuse in the resource file from the Global Script tab (see Global Script (Profile)).
  7. [optional] Click the Post-Process tab and enter VBScript to run after all the objects have been imported.
  8. Click the General tab and click the Mappings button to define mappings from the metaclasses identified in your XML schema to those in the PowerDesigner metamodel in the Mapping Editor (see XML Import Mappings).
  9. Click Apply to save your changes.