Sybase PowerDesigner XML User Manual

XML Model User's Guide
Sybase
11.1
Windows
®
PowerDesigner
®
LAST REVISED: June 2005
Copyright © 1991-2005 Sybase, Inc. All rights reserved. Information in this manual may change without notice and does not represent a commitment on the part of Sybase, Inc. and its subsidiaries. Sybase, Inc. provides the software described in this manual under a Sybase License Agreement. The software may be used only in accordance with the terms of the agreement. No part of this publication may be reproduced, transmitted, or translated in any form or by any means, electronic, mechanical, manual, optical, or otherwise, without the prior written permission of Sybase, Inc. Use, duplication, or disclosure by the government is subject to the restrictions set forth in subparagraph (c)(1)(ii) of DFARS 52.227­7013 for the DOD and as set forth in FAR 52.227-19(a)-(d) for civilian agencies.
Sybase, SYBASE (logo), ADA Workbench, Adaptable Windowing Environment, Adaptive Component Architecture, Adaptive Server, Adaptive Server Anywhere, Adaptive Server Enterprise, Adaptive Server Enterprise Monitor, Adaptive Server Enterprise Replication, Adaptive S erver Everyw here, Afaria, Answers Anywhere, AppModeler , APT Workb ench, APT-Build, APT-Edit, APT-Execute, APT­Translator, APTLibrary, ASEP, AvantGo,Backup Server, BayCam, Bit-Wise, BizTracker, Certified PowerBuilder Developer, Certified SYBASE Professional, Certified SYBASE Professional Logo, ClearConnect, Client-Library, Client Services, CodeBank, Column Design, ComponentPa ck, Conne ction Mana ger, Convoy/DM, Co pernicus, CSP, Dat a Pipeline, Data Wor kbench, D ataArchite ct, Database Analyzer, DataExpress, DataServer, DataWindow, DB-Library, dbQueue, Developers Workbench, DirectConnect Anywhere, DirectConnect, Distribution Director, Dynamic Mobility Model, e-ADK, E-Anywhere, e-Biz Integrator, E-Whatever, EC Gateway, ECMAP, ECRTP, eFulfillment Accelerator, Electronic Case Management, Embedded SQL, EMS, Enterprise Application Studio, Enterprise Client/Server, Enterprise Connect, Enterprise Data Studio, Enterprise Ma nager, Enterp rise Po rta l (logo), Enterprise SQL Server Manager, Enterprise Work Architecture, Enterprise Work Designer, Enterprise Work Modeler, eProcurement Accelerator, eremote, Everything Works Better When Eve rything Works T ogether, EWA, Financia l Fusion, Financial Fusion (and design), Fina ncial Fusion Server, Formula One, Fusion Powered e-Finance, Fusion Powered Financial Destinations, Fusion Powered STP, Gateway Manager, GeoPoint, GlobalFIX, iAnywhere, iAnywhere Solutions, ImpactNow, Industry Warehouse Studio, InfoMaker, Information Anywhere, Information Everywhere, InformationConnect, I nstaHelp, Intelligent S elf-Care , InternetBuilder, iremote, iSc ript, Ja guar CTS, jConnect for JDBC, KnowledgeBase, Logical Memory Manager, M2M Anywhere, Mach Desktop, Mail Anywhere S tudio, MainframeC onnect, M aintenance E xpress, Manage Anywhere Studio, MAP, M-B usiness Anywhere, M-Business Channel, MBus iness Network, MDI Access Server, MDI Database Gateway, media.splash, Message Anywhere Server, MetaWorks, MethodSet, mFolio, Mirror Activator, ML Query, MobiCATS, MySupport, Net-Gateway, Net- Library, New Era of Networks, Next Generation Learning, Next Generation Learning Studio, O DEVICE, OASiS, OASiS logo, ObjectConnect, ObjectCycle, OmniConnect, OmniSQL Access Module, OmniSQL Toolkit, Open Biz, Open Business Interchange, Open Client, Open ClientConnect, Open Client/Server, Open Client/Server Interfaces, Open Gateway, Open Server, Open ServerConnect, Open Solutions, Optima++, Partnerships that Work, PB­Gen, PC APT Execute, PC DB-Net, PC Net Library, PhysicalArchitect, Pocket PowerBuilder, PocketBuilder, Power++, Power Through Knowle dge, pow er.sto p, Power A MC, Pow erBuilder, PowerBuilder Foundatio n Class Library, PowerDesigner, PowerDimensions, PowerDynamo, Powering the New Economy, PowerScript, PowerSite, PowerSocket, Powersoft, PowerStage, PowerStudio, PowerTips, Powersoft Portfolio, Powersoft Professional, PowerWare Desktop, PowerWare Enterprise, ProcessAnalyst, Pylon, Pylon Anywhere, Pylon Application Server, Pylon Conduit, Pylon PIM Server, Pylon Pro, QAnywhere, Rapport, Relational Beans, RemoteWare, RepConnector, Report Workbench, Report-Execute, Replication Agent, Replication Driver, Replication Server, Replication Serve r Manager, Replica tion Toolkit, Resource Manager, RFID Anywhere, R W-DisplayLib , RW-Library, SAFE, SAFE/PRO, SDF, Secure SQL Server, Secure SQL Toolset, Security Guardian, SKILS, smart.partners, smart.parts, smart.script, SQL Advantage , SQL Anywhere, SQL Anywhere Studio, SQ L C ode Chec ker, SQL Debug, SQL Edit , SQL Edit/TPU, SQL Ever ywhere, SQL Modeler, SQL Remote, SQL Server, SQL Server Manager, SQL SMART, SQL Toolset, SQL Server/CFT, SQL Server/DBM, SQL Server SNMP SubAgent, SQL Station, SQLJ, Stage III Engineering, Startup.Com, STEP, SupportNow, S.W.I.F.T. Message Format Libraries, Sybase Central, Sybase Client/Server Interfaces, Sybase Development Framework, Sybase Financial Server, Sybase Gateways, Sybase IQ, Sybase Learning Connection, Sybase MPP, Sybase SQL Desktop, Sybase SQL Lifecycle, Sybase SQL Workgroup, Sybase Synergy Program, Sybase Virtual Server Architecture, Sybase User Workbench, SybaseWare, Syber Financial, SyberAssist, SybFlex, SybMD, SyBooks, System 10, System 11, System XI (logo), SystemTools, Tabular Data Stream, The Enterprise Client/Server Company, The Extensible Software Platform, The Future Is Wide Open, The Learning Connection, The Model For Client/Server Solutions, The Online Information Center, The Power of One, TotalFix, TradeForce, Transact-SQL, Translation Toolkit, Turning Imaginatio n Into Reality, UltraLit e, Ultra Lit e.NET, UNIBOM, Unilib, Uninull, Unisep, Unistring, U RK Runtime Kit for UniCode, Viewer, VisualWriter, VQL, WarehouseArchitect, Warehouse Control Center, Warehouse Studio, Warehouse WORKS, Watcom, Watcom SQL, Watcom SQL Server, Web Deployment Kit, Web.PB, Web.SQL, WebSights, WebViewer, WorkGroup SQL Server, XA-Library, XA-Server, XcelleNet, and XP Server are trademarks of Sybase, Inc. or its subsidiaries.
All other trademarks are property of their respective owners.
Contents
About This Book ............................................................................................ix
1 XML Model Basics..............................................................1
Functional overview..................................................................2
What is an XML model? ...........................................................3
About XML.......................................................................... 4
Objects in an XML model...................................................5
How to link a child object to a parent object in an
XML model?.......................................................................8
Defining the XML model environment..................................... 10
Choosing the XML language of an XML model................ 10
Changing the XML language of an XML model................ 11
Selecting extended model definitions at model creation..13
Defining model options..................................................... 14
XML model extended dependencies................................15
Defining an XML model .......................................................... 17
Defining model properties ................................................17
Creating an XML model.................................................... 24
Opening an existing XML model ......................................28
Detaching an XML model from the workspace ................ 28
Saving and closing an XML model...................................29
2 Building an XML model....................................................31
XML diagram basics ............................................................... 32
Defining an XML diagram................................................. 32
Why build an XML diagram? ............................................ 33
Creating an XML diagram ................................................ 34
Defining elements...................................................................35
Defining element properties .............................................36
Creating an element.........................................................43
How to link a child object to an element?.........................45
Defining the attributes of an element................................ 46
Modifying element display preferences............................52
Linking child elements to a parent element...................... 52
Defining Any properties....................................................58
Modifying the Any display preference...............................61
XSM User's Guide iii
Defining Any Attribute properties...................................... 61
Defining identity constraints.................................................... 64
Defining a unique constraint............................................. 64
Defining a key constraint.................................................. 66
Defining a keyRef constraint ............................................ 67
Creating an identity constraint.......................................... 69
Defining an identity constraint selector............................. 70
Defining an identity constraint field................................... 73
Defining groups....................................................................... 76
Defining a group of elements ........................................... 76
How to link a child object to a group of elements?........... 81
Modifying the group display preference ........................... 82
Defining a group of attributes........................................... 82
Managing external shortcuts through references and data
types ....................................................................................... 87
Defining simple types.............................................................. 89
What is a simple type?..................................................... 89
Defining simple type properties........................................ 90
Modifying the simple type display preference................... 90
Creating a simple type...................................................... 90
Defining complex types........................................................... 92
What is a complex type?.................................................. 92
Defining complex type properties..................................... 93
Modifying complex type display preferences.................... 96
Creating a complex type................................................... 96
How to link a child object to a complex type?...................98
Defining simple content properties................................. 100
Defining complex content properties.............................. 101
Defining derivations .............................................................. 102
Deriving by extension..................................................... 102
Deriving by restriction..................................................... 104
Deriving by list................................................................ 112
Deriving by union............................................................ 113
Defining annotations.............................................................115
Defining annotation properties ....................................... 116
Defining documentation properties ................................ 116
Defining application information properties.................... 117
Creating an annotation................................................... 118
Defining notations.................................................................120
Defining notation properties ........................................... 120
Creating a notation......................................................... 121
Defining entities .................................................................... 122
Defining entity properties................................................ 122
Creating an entity........................................................... 123
Defining import, include and redefine ................................... 125
Defining an import.......................................................... 125
iv PowerDesigner
Defining an include......................................................... 127
Defining a redefine ......................................................... 128
Defining business rules......................................................... 132
What is a business rule?................................................ 132
Defining business rule properties...................................132
Creating a business rule................................................. 133
Applying a business rule to an XML object .................... 135
3 Working with an XML model .........................................139
Checking an XML model.......................................................140
XML model check options .............................................. 140
XML model object selection in the Check Model ........... 141
Checking an XML model................................................142
Displaying previously applied check options in an
XML model.....................................................................144
Making corrections based on XML model check
results............................................................................. 145
XML Model objects verified by Check Model........................ 147
Group particle check ...................................................... 147
Model check ...................................................................148
Business rule check in an XSM...................................... 149
Data source check ......................................................... 149
File check .......................................................................150
Entity check....................................................................151
Include check ................................................................. 152
Simple type check .......................................................... 152
Complex type check.......................................................152
Element check................................................................ 153
Group check...................................................................155
Attribute check................................................................ 156
Notation check................................................................ 156
Attribute group check ..................................................... 157
Import check................................................................... 158
Redefine check............................................................... 158
Key check....................................................................... 159
KeyRef check.................................................................160
Unique check.................................................................. 161
Extended object check ...................................................162
Extended link check .......................................................162
Replication check ........................................................... 163
Extension check ............................................................. 163
Restriction check............................................................163
Simple type list check..................................................... 164
Simple type union check ................................................165
Annotation check............................................................ 165
Mapping objects in an XML model........................................166
XSM User's Guide v
Understanding object mapping ...................................... 166
Defining data sources in an XML model ........................ 166
Mapping XML Model objects to PDM objects ................ 169
Mapping XML Model objects to OOM objects................ 171
Creating a mapping for an XML object........................... 172
Modifying the mapping of an attribute............................ 175
Manipulating XML objects graphically................................... 176
Local objects .................................................................. 176
Global objects................................................................. 177
Example: converting a local object into a global object.. 177
Comparing and merging XML models.................................. 179
Generating an XML model from a Physical Data Model....... 180
Generating XML Model objects...................................... 180
Generating and updating an XML model ....................... 181
Defining XML model generation options ........................ 182
Generating a new XML model from a PDM ................... 184
Updating an existing XML model ................................... 185
Generating an XML model from an Object-Oriented Model . 188
Generating XML Model objects...................................... 188
Generating and updating an XML model ....................... 189
Defining XML model generation options ........................ 190
Generating a new XML model from an OOM................. 192
Updating an existing XML model ................................... 193
Editing an XML model report ................................................ 196
What is a report?............................................................ 196
Creating an XML model report....................................... 196
How can a report underline the hierarchical structure
of an XML model?..........................................................198
4 Generating and reverse engineering an XSD,
a DTD or an XDR file......................................................201
Generating an XSD, a DTD or an XDR file........................... 202
Why generate an XSD file?............................................ 202
Why generate a DTD file?.............................................. 202
Why generate an XDR file?............................................ 202
Defining generation parameters..................................... 203
How to generate an XSD, a DTD or an XDR file?.......... 205
Reverse engineering an XSD, a DTD or an XDR file........... 208
What is reverse engineering? ........................................ 208
Why reverse engineer an XSD, a DTD or an XDR
file?................................................................................. 208
How to reverse engineer an XSD, a DTD or an XDR
file?................................................................................. 208
vi PowerDesigner
5 Exchanging data with databases supporting XML......215
Why use XML in databases?................................................216
Generating an annotated schema for Microsoft SQL
Server 2000 .......................................................................... 217
Mapping XML objects to PDM objects ........................... 217
Reinforcing mapping with extended attributes ............... 225
Generating an annotated schema for Oracle 9i2..................230
Generating a DAD file for IBM DB2 ...................................... 237
Generating SQL/XML queries...............................................249
6 Generating from an XML model....................................255
Generation basics................................................................. 256
Target models parameters............................................. 256
Generating an XML model from an XML model ................... 259
Why generate an XML model from an XML model?......259
Generating and updating an XML model........................ 259
XML Model Glossary.........................................................................................267
Index .........................................................................................271
XSM User's Guide vii
viii PowerDesigner

About This Book

Subject
Audience
This book describes the PowerDesigner XML Model environment. It shows you how to do the following:
Build an XML model Work on an XML model Generate and reverse engineer a DTD file Generate and reverse engineer an XSD file Generate and reverse engineer an XDR file Generate an annotated schema Generate a DAD file Generate an SQL/XML query Generate an XML model from a PDM Generate an XML model from an OOM Generate an XML model from another XML model
This book is for anyone who will be designing or building an XML model with PowerDesigner. It requires an understanding of XML. Some experience with XML Schema might also be helpful but not required. For more information, see the Bibliography section at the end of this chapter.
Documentation primer
XSM User's Guide ix
The PowerDesigner modeling environment supports several types of models: Conceptual Data Model (CDM) to model the overall logical structure
of a data application, independent from any software or data storage structure considerations
Physical Data Model (PDM) to model the overall physical structure of
a database, taking into account DBMS software or data storage structure considerations
About This Book
Object Oriented Model (OOM) to model a software system using an
object-oriented approach for Java or other object languages
Business Process Model (BPM) to model the means by which one or
more processes are accomplished in operating business practices
XML Model (XSM) to model the structure of an XML file using a DTD
or an XML schema
Requirements Model (RQM) to list and document the customer needs
that must be satisfied during a development process
Information Liquidity Model (ILM) to model the replication of
information from a source database to one or several remote databases using replicati on engines
Free Model (FEM) to create any kind of chart diagram, in a context-
free environment
This book only explains how to use the XML Model. For information on other models or aspects of PowerDesigner, consult the following books:
General Features Guide To get familiar with the PowerDesigner
interface before learning how to use any of the models.
Conceptual Data Model Getting Started To learn the basics of the
CDM.
Conceptual Data Model User’s Guide To work with the CDM. Physical Data Model Getting Started To learn the basics of the PDM. Physical Data Model User’s Guide To work with the PDM. Object Oriented Model Getting Started To learn the basics of the
OOM.
Object Oriented Model User's Guide To work with the OOM. Business Process Model Getting Started To learn the basics of the
BPM.
Business Process Model User’s Guide To work with the BPM. Requirements Model User’s Guide To work with the RQM. Information Liquidity Model User’s Guide To work with the ILM. Reports User’s Guide To create reports for any or all models.
x PowerDesigner
About This Book
Repository Getting Started To learn the basics of the Repository. Repository User’s Guide To work in a multi-user environment using a
central repository.
Typographic conventions
Bibliography
PowerDesigner documentation uses specific typefaces to help you readily identify specific items:
monospace text (normal and bold)
Used for: Code samples, commands, compiled functions and files, references to variables. Example: declare user_defined…, the BeforeInsertTrigger template.
UPPER CASE
Object codes, reversed objects, file names + extension. Example: The AUTHOR table appears in the Browser. Open the file OOMAFTER.OOM.
bold text
Any new term. Example: A shortcut has a target object.
SMALL CAPS
Any key name. Example: Press the
ENTER key.
W3C XML R ecommendation – htt p://www.w3. org/TR/REC-xml
W3C DTD Recommend ation – http://www.w3.org/TR/REC-xml#dt-doct y pe
W3C XML Schema Recommendation – http://www.w3.org/XML/Schema#dev
W3C XML-Data Note – http://www.w3.org/TR/1998/NOTE-XML-data­0105/
XSM User's Guide xi
About This Book
xii PowerDesigner
CHAPTER 1

XML Model Basics

About this chapter
Contents
This chapter presents PowerDesigner XML Model. It provides you with an introduction to the basic notions of XML modeling.
Topic Page
Functional overview 2 What is an XML model? 3 Defining the XML model environment 10 Defining an XML model 17
XSM User's Guide 1
Functional overview
Functional overview
With the graphical interface and the Browser tree view of PowerDesigner XML Model, you can design an XML diagram which represents the content of an XML Schema Definition file (.XSD), a Document Type Definition file (.DTD) or an XML-Data Reduced file (.XDR). Since XML structures can be very complex, it is much ea s ier to visualize them through comprehensive and explicit diagrams, than to read XML-coded pages.
Once you have created an XML diagram, you can generate an XSD, a DTD or an XDR file to share the structure of an XML document via an ordinary plain text file.
Conversely, you will be able to reverse engineer an XSD, a DTD or an XDR file into an XML model, with its corresponding diagram.
The XML Model allows you to:
Build an XML model Check an XML model Map objects in an XML model Edit a report of an XML model Generate and reverse engineer an XSD, a DTD or an XDR file Generate an XML model from a Physical Data Model (PDM) Generate an XML model from an Object Oriented Model (OOM) Generate an XML model from an XML model
2 PowerDesigner
What is an XML model?
An XML model is a graphical representation of an XML Schema Definition file (.XSD), a Document Type Definition file (.DTD) or an XML-Data Reduced file (.XDR).
With its Browser tree view and diagram, an XML model gives you a global and schematic view of all the elements composing an XSD, a DTD or an XDR file. This is very helpful when you need to understand, check or modify the complex structure of an XSD, a DTD or an XDR file.
Example of an XML model (Browser and diagram):
Chapter 1 XML Model Basics
Demo models
Demo XML models are available in the Examples directory.
XSM User's Guide 3
What is an XML model?
About XML
Why use XML?
DTD, XSD or XDR
The eXtensible Markup Language is used for different reasons:
It describes and structures data, whereas HTML only displays data It uses a self-describing and personalized syntax It can be exchanged between incompatible systems, since data is stored
in plain text format
The structure of an XML model is described by a DTD, an XSD or an XDR file:
A DTD file is a basic way to describe the structure of an XML
document. It is a raw list of all the legal elements making up an XML document
Extract of a DTD file:
An XSD file (or schema) is an elaborated way to describe the structure
of an XML document. It can support namespaces, derivations, keys, simple and complex user-defined data types and a robust collection of predefined data types
4 PowerDesigner
Chapter 1 XML Model Basics
Extract of an XSD file:
An XSD file always starts with the <schema> tag (root element). All objects created in the model will appear in the XSD file between the schema start-tag and end-tag
An XDR file is a simplified XSD file (or schema). It does not support
simple and complex user-defined data types Extract of an XDR file:
An XDR file always starts with the <schema> tag (root element). All objects created in the model will appear in the XDR file between the schema start-tag and end-tag
Objects in an XML model
An XML model represents the structure of a potential or existing XML document through a n XSD, a DTD o r an XDR file.
XSM User's Guide 5
What is an XML model?
An XML model is a tree structure of child elements attached to parent elements. Elements are the basic describing items of an XML model. They can be made of other elements combined in different ways through group particles. Elements are specified by attributes and data types which can be predefined or user-defined. Simple and complex data types can be defined as global (directly linked to the <schema> tag) or local (embedded in an element declaration).
The following table displays the specific objects of an XML model:
Tool Object Description
Element The basic object of an XML model. An element
can contain other elements or attributes
Group A group of elements arranged by a group particle.
A group is defined once and reused elsewhere in the model through references
Any Any type of object. Any can only be attached to a
sequence or a choice group particle
Attribute Additional information about an element or a
complex type. An attribute is defined by a built-in data type or a simple data type
Attribute Group A group of attributes. An attribute group is
defined once and reused elsewhere in the model through references
Simple Type A simple data type. A simple type is used in the
case of elements or attribut es with text-only content. Only available in a model targeted with XSD
Complex Type A complex data type. A complex type is used to
introduce elements or attributes within an element declaration. Only availab le in a model targeted with XSD
Sequence A group particle to arrange a set of elements. A
sequence group particle indicates that elements must appear at least once in t he order of their declaration
Choice A group particle to arrange a set of elements. A
choice group particle indicates that one element must be chosen among all elements
All A group particle to arrange a set of elements. An
all group particle indicates that each element can appear once or not, in any order
6 PowerDesigner
Chapter 1 XML Model Basics
Tool Object Description
Notation A notation is used to define and process non-
XML objects within an XML model
These tools are available in the palette of the diagram window. The main objects of an XML model are represented by symbols in its
diagram.
Objects in a diagram
Some objects may not appear in a diagram because they do not have a symbol or this symbol has been deleted or hidden. Always check the existence of objects in the Browser tree view.
Example of an XML diagram:
You can use several diagrams to have partial views of a complex diagram.
XSM User's Guide 7
What is an XML model?
How to link a child object to a parent object in an XML model?
XML objects do not support standard link objects. To link a child object to a parent object, you must click the child object tool in the palette and then click the symbol of the parent object in the diagram. This will automatically create a link between both objects. See the following table for allowed links:
Complex type
Tool Element symbol Group symbol
Any
No link No link No link
symbol
All
Tool Sequence symbol Choice symbol All symbol
No link
Any
No link
No link No link No link
8 PowerDesigner
Chapter 1 XML Model Basics
Tool Sequence symbol Choice symbol All symbol
No link
No link
No link No link No link
All
Caution
A group particle (sequence, choice, all) cannot be created from scratch in a diagram. It must be the child element of an element, a group or a complex type.
For more information, see sections How to link a child object to an
element, How to link a child object to a group particle, How to link a child object to a group of elements, How to link a child object to a complex type, in chapter Building an XML model.
XSM User's Guide 9
Defining the XML model environment
Defining the XML model environment
The XML model environment includes a set of parameters and configuration options that define various aspects of the model content and behavior. You can set these parameters:
At model creation After creating a model with default options and parameters When creating a model template
Choosing the XML language of an XML model
An XML language contains specifications for a partic ular language. It provides PowerDesigner with the syntax and guidelines for implementing stereotypes, d ata types, scripts and constants for an XML la nguage. You manage an XML language from the Resource Edi tor. The langua ge displays a tree view with several categories that can be used to extend XML model objects (Profile category) or manage generation (Generation category).
Each XML model is by default attached to an XML language. When you create a new XML model, you must choose an X ML language. You can create a new XML language or use the XM L l anguages delivered with PowerDesigner.
The definition of an XML language is available from its property sheet. You can select and configure parameters used when defining objects or generating from an XML model.
For more information on XML language s, see chapter XML Languages
Reference Guide in the Advanced User Documentation.
For more information on resource files, see chapter The Resource
Editor in the General Features Guide.
Not certified resource file
Some resource files are delivered with "Not Certified" in their names. Sybase will perform all possible validation checks, however Sybase does not maintain specific environments to fully certify these resource files. Sybase will support the definition by accepting bug reports and will provide fixes as per standard policy, with the exception that there will be no final environmental validation of the fix. Users are invited to assist Sybase by testing fixes of the definition provided by Sybase and report any continuing inconsistencies.
10 PowerDesigner
Changing the XML language of an XML model
If you change the XM L language of an XML model, you have to define the status of the language:
XML language Description
Share To use the shared XML language stored in the XML Languages
directory of your installation. Any changes made to the XML language are available to the linked XML model
Copy To create a copy of the XML language in the model. The current
XML language is independent from the original XML language, so any changes made in the XML language are not available to other models. The XML language is saved with the model and cannot be used by other models
Caution
PowerDesigner is delivered with a set of XML languages. It is strongly advised to make a backup copy of each XML language before you start modifying them.
Chapter 1 XML Model Basics
To change the XML language of an XML model:
1 Select LanguageChange Current Language.
The Change XML La nguage dialog bo x appears.
2 Select an XML langua ge. 3 Select the Share or Copy radio button.
XSM User's Guide 11
Defining the XML model environment
4 Click OK.
A message box informs you that the current XML language has been changed.
5 Click OK.
Changes concerning simple and complex types
Simple types and complex types are only supported by XSDs (schemas). When changing an XSD into a DTD or an XDR, simple types and global complex types (directly linked to the <schema> tag) disappear from the diagram and the Browser tree view. Local complex types (within an element) are expanded in the diagram, beneath their containing element.
Example of a complex type with XSD:
HighDefinition is a global complex type, reused as data type for the deluxeTV element.
The same example with DTD or XDR:
For more information on simple and complex types, see sections
Defining simple types and Defining complex types in chapter Building an XML model.
12 PowerDesigner
Chapter 1 XML Model Basics
Selecting extended model definitions at model creation
Extended model definitions (.XEM files) provide means for customizing and extending PowerDesigner metaclasses, parameters and generation. Extended model definitions are typed like models in PowerDesigner. You create an extended model definition for a specific type of model and you cannot share these files between heterogeneous models.
When you create a new XML model, or when you reverse engineer into a new XML model, you can select one or several extended model definitions and attach them to the model from the New dialog box.
You can choose one of the following options:
Option Description
Share Current extended model definition constantly refers to the extended
model definition stored in the Resource Files\Extended Model Definitions directory. Any changes made to the extended model definition are shared by all linked XEM
Copy Current extended model definition is a unique copy of the extended
model definition stored in the Resource Files\Extended Model Definitions directory. The current extended model definition is independent of the original one, so modifications made to the extended model definition in the Resource Files\Extended Model Definitions directory are not available to the copied XEM. This one is saved with the XML model and cannot be used without it
XSM User's Guide 13
Defining the XML model environment
For more information on extended model definitions, see chapter
Extended Model Definitions Reference Guide, in the Advanced User Documentation.
Defining model options
Name/Code case sensitive
Enable links to requirements
Naming conventions
You can define the case sensitivity of names and codes for all objects in the current model. When this check box is selected, it implies that you can have two objects with identical name or code but different case in the same namespace.
Unlike other model options, you can modify the name and code case sensitivity during the design process. However, if you do so, make sure you run the check model feature to verify if the model does not contain any duplicate object.
Requirements are descriptions of customer needs that must be satisfied during development processes.
You can enable links to requirements for all objects in the current model. When this check box is selected, it implies that the Requirements tab appears in the objects property sheet. The Requirements page allows you to attach requirements to objects; these requirements are defined in the Requirements models open in the workspace. Attached requirements and Requirements models are synchronized.
For more information on requirements, see the Requirements Model
User’s Guide.
You can also set naming conventions for each type of objects in your model.
For information on naming conventions, see section Defining naming
conventions, fr om chapter Managing Models, in the General Features Guide.
14 PowerDesigner
To define XML model options:
1 Select Tools→Model Options.
or
Right-click the diagram background and select Model Options in the contextual menu.
The Model Options dialog box opens to the Model Settings pane.
Chapter 1 XML Model Basics
2 Select or clear the Name/Code case sensitive check box in the All
Objects groupbox.
3 Click OK.
XML model extended dependencies
Extended dependencies are links between objects of an XML model. These links help to make object relationships clearer but are not interpreted and checked by PowerDesigner as they are meant to be used for documentation purposes only.
You can complement these links by applying stereotypes. Stereotypes can be used to define extended dependencies between objects in an XML model.
XSM User's Guide 15
Defining the XML model environment
You can type stereotypes directly in the Stereotype column of the object property sheet or select a value from the dropdown listbox if you have previously defined stereotypes in an embedded or imported extended model definition (.XEM).
For more information on extended model definitions, see chapter
Extended Model Definitions Reference Guide in the Advanced User Documentation.
16 PowerDesigner
Defining an XML model
This section presents the main operations you have to perform before starting to build or work on an XML model.
Defining model properties
The model property sheet displays the definition of the current model. Only the specific pages of an XML model are explained in this section.
For information on the generic pages of a model property sheet, see
section Using property sheets in chapter Using the PowerDesigner Interface in the General Features Guide.
To define the properties of an XML model:
1 Select ModelModel Properties.
or
Right-click the diagram background and select Prop erties from the contextual menu.
Chapter 1 XML Model Basics
The model property sheet appears.
2 Type changes to model properties in the different pages.
XSM User's Guide 17
Defining an XML model
Model General page
If you want to display the XML language, click the Properties t ool beside the XML language box in the Ge neral page to display the property sheet of the XML language .
3 Click OK.
The General page of the model property sheet displays the following properties:
Property Description
Name The name of the item which should be clear and meaningful,
and should convey the item's purpose to non-technical users
Code The technical name of the item used for generating code or
scripts, which may be abbreviated, and should not generally
include spaces Comment Descriptive label of the model File name Location of the model file. This box is empty if the model has
never been saved Author Author o f the model. You can insert a name, a space or
nothing. If you insert a space, the Author field in the title box
remains empty. If you intentionally leave the box empty, the
Author field in the title box displays the user name from the
Version Info page of the model property sheet Version Version of the model. You can use this box to display the
repository version or a user-defined version of the model.
This parameter is defined in the display preferences of the
Title node XML language Current XML language for the model Default diagram Diagram displayed by default when opening the model
18 PowerDesigner
Loading...
+ 260 hidden pages