
Chapter 2 XML Model Basics
Creating an XSM
You can create a new XSM from scratch, or reverse engineer the model from an existing XSD, a DTD or an XDR file.
For information about reverse engineering, see the "Generating and reverse engineering an XSD, a DTD or an XDR file" chapter.
To create a new XSM:
- Select File→New to display the New dialog box.
- Select XML Model in the list of model types.
- Select one of the following radio buttons:
- New model – Creates a new, standard, model.
- New model from template – Creates a model from a model template. A model template is a set of model options, display preferences, extension, or objects saved in a model located in the template folder. You use model templates when you need to reuse preferences and options in several models.
For more information about model templates, see the "Creating a model" section in the "Managing Models" chapter , in the General Features Guide
.
- Type a model name in the Model name box. The code of the model, which may be used for script or code generation, is derived from this name according to the model naming conventions.
- Select an XML language from the list.
XML languages are defined in dedicated XML files (with a .xsl extension), which are provided as part of your PowerDesigner installation in the "\Resource Files\XML languages" directory, and contain all the syntax and specifications for each target XML language.
- Select one of the following radio buttons:
- Share the XML language definition – use the original XSM file in the "Resource Files\XML languages" directory. Any changes made to the XML language are shared by all linked XSMs.
- Copy the XML language definition in model – make a copy of the original XML language file in the "Resource Files\XML languages" directory. The current XML language is independent of the original XML language, so modifications made to the file in the XML languages directory are not available to the XSM. The copied object language is saved with the XSM and cannot be used without it.
For more information on XML language properties and customizing an XML language, see the "XML language Reference Guide" chapter in the Advanced User Documentation
.
- [optional] If you want to attach one or more extended model definitions to complement the selected XML language, click the Extended Model Definitions tab, and select the extended model definitions of your choice.
For more information on attaching extended model definition to a model, see the "Extended Model Definitions Reference Guide" chapter in the Advanced User Documentation
.
- Click OK to create the new XSM in the current Workspace.
Demo example
Several example XSMs are available in the Examples directory.
Copyright (C) 2007. Sybase Inc. All rights reserved.
|
|