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 Guideix
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.
xPowerDesigner
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
This chapter presents PowerDesigner XML Model. It provides you with an
introduction to the basic notions of XML modeling.
TopicPage
Functional overview2
What is an XML model?3
Defining the XML model environment10
Defining an XML model17
XSM User's Guide1
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
2PowerDesigner
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 Guide3
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
4PowerDesigner
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 Guide5
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:
ToolObjectDescription
ElementThe basic object of an XML model. An element
can contain other elements or attributes
GroupA group of elements arranged by a group particle.
A group is defined once and reused elsewhere in
the model through references
AnyAny type of object. Any can only be attached to a
sequence or a choice group particle
—AttributeAdditional information about an element or a
complex type. An attribute is defined by a built-in
data type or a simple data type
—Attribute GroupA group of attributes. An attribute group is
defined once and reused elsewhere in the model
through references
—Simple TypeA 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 TypeA 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
SequenceA 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
ChoiceA group particle to arrange a set of elements. A
choice group particle indicates that one element
must be chosen among all elements
AllA group particle to arrange a set of elements. An
all group particle indicates that each element can
appear once or not, in any order
6PowerDesigner
Chapter 1 XML Model Basics
ToolObjectDescription
—NotationA 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 Guide7
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
ToolElement symbolGroup symbol
Any
No linkNo linkNo link
symbol
All
ToolSequence symbolChoice symbolAll symbol
No link
Any
No link
No linkNo linkNo link
8PowerDesigner
Chapter 1 XML Model Basics
ToolSequence symbolChoice symbolAll symbol
No link
No link
No linkNo linkNo 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 Guide9
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.
10PowerDesigner
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
languageDescription
ShareTo 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
CopyTo 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:
1Select Language→Change Current Language.
The Change XML La nguage dialog bo x appears.
2Select an XML langua ge.
3Select the Share or Copy radio button.
XSM User's Guide11
Defining the XML model environment
4Click OK.
A message box informs you that the current XML language has been
changed.
5Click 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.
12PowerDesigner
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:
OptionDescription
ShareCurrent 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
CopyCurrent 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 Guide13
Defining the XML model environment
For more information on extended model definitions, see chapter
Extended Model Definitions Reference Guide, in the Advanced UserDocumentation.
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.
14PowerDesigner
To define XML model options:
1Select 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
2Select or clear the Name/Code case sensitive check box in the All
Objects groupbox.
3Click 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 Guide15
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 UserDocumentation.
16PowerDesigner
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:
1Select Model→Model 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.
2Type changes to model properties in the different pages.
XSM User's Guide17
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 .
3Click OK.
The General page of the model property sheet displays the following
properties:
PropertyDescription
NameThe name of the item which should be clear and meaningful,
and should convey the item's purpose to non-technical users
CodeThe technical name of the item used for generating code or
scripts, which may be abbreviated, and should not generally
include spaces
CommentDescriptive label of the model
File nameLocation of the model file. This box is empty if the model has
never been saved
AuthorAuthor 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
VersionVersion 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 languageCurrent XML language for the model
Default diagramDiagram displayed by default when opening the model
18PowerDesigner
Loading...
+ 260 hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.