XML UserGuide PDF
XML UserGuide PDF
User’s Guide
Sybase® PowerDesigner®
12.0
Windows
Part number: DC200014-01-1200-01
Last modified: December 2005
Copyright © 1991-2005 Sybase, Inc. and its subsidiaries. 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. and its subsidiaries.
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 Server
Everywhere, Afaria, Answers Anywhere, Applied Meta, Applied Metacomputing, AppModeler, APT Workbench, APT-Build, APT-Edit,
APT-Execute, APT-Translator, APT-Library, ASEP, Avaki, Avaki (Arrow Design), Avaki Data Grid, Avaki (Swirl Design), 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, ComponentPack, Connection Manager, Convoy/DM, Copernicus, CSP,
Data Pipeline, Data Workbench, DataArchitect, 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, EII Plus, Electronic Case Management, Embedded SQL, EMS, Enterprise
Application Studio, Enterprise Client/Server, Enterprise Connect, Enterprise Data Studio, Enterprise Manager, Enterprise Portal (logo), Enterprise
SQL Server Manager, Enterprise Work Architecture, Enterprise Work Designer, Enterprise Work Modeler, eProcurement Accelerator, eremote,
Everything Works Better When Everything Works Together, EWA, Financial Fusion, Financial Fusion (and design), Financial 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, InstaHelp, Intelligent Self-Care, InternetBuilder, iremote, iScript, Jaguar CTS, jConnect for JDBC, KnowledgeBase, Legion,
Logical Memory Manager, M2M Anywhere, Mach Desktop, Mail Anywhere Studio, Mainframe Connect, Maintenance Express, Manage Anywhere
Studio, MAP, M-Business Anywhere, M-Business Channel, M-Business Network, M-Business Suite, 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++,
Pharma Anywhere, Partnerships that Work, PB-Gen, PC APT Execute, PC DB-Net, PC Net Library, PhysicalArchitect, Pocket PowerBuilder,
PocketBuilder, Power++, Power Through Knowledge, power.stop, PowerAMC, PowerBuilder, PowerBuilder Foundation 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 Server Manager,
Replication Toolkit, Resource Manager, RFID Anywhere, RW-DisplayLib, RW-Library, SAFE, SAFE/PRO, Search Anywhere, SDF, Search
Anywhere, Secure SQL Server, Secure SQL Toolset, Security Guardian, SKILS, smart.partners, smart.parts, smart.script, SOA Anywhere
Trademark,SQL Advantage, SQL Anywhere, SQL Anywhere Studio, SQL Code Checker, SQL Debug, SQL Edit, SQL Edit/TPU, SQL
Everywhere, 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 Imagination Into Reality, UltraLite, UltraLite.NET, UNIBOM, Unilib, Uninull, Unisep,
Unistring, URK 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, Work As
One, WorkGroup SQL Server, XA-Library, XA-Server, XcelleNet, and XP Server are trademarks of Sybase, Inc. or its subsidiaries.
ii
Contents
iii
5 Exchanging data with databases supporting XML 215
Why use XML in databases? . . . . . . . . . . . . . . . . . . 216
Generating an annotated schema for Microsoft SQL Server
2000 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217
Generating an annotated schema for Oracle 9i2 . . . . . . . 230
Generating a DAD file for IBM DB2 . . . . . . . . . . . . . . . 237
Generating SQL/XML queries . . . . . . . . . . . . . . . . . . 249
Index 263
iv
About This Manual
Subject
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
Audience
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
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
v
♦ 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 replication 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 User’s Guide To work with the CDM.
Physical Data Model User’s Guide To work with the PDM.
Object Oriented Model User’s Guide To work with the OOM.
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.
Repository User’s Guide To work in a multi-user environment using a
central repository.
Typographic conventions
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.
vi
♦ bold text
Any new term.
Example: A shortcut has a target object.
♦ SMALL CAPS
vii
viii
CHAPTER 1
About this chapter This chapter presents PowerDesigner XML Model. It provides you with an
introduction to the basic notions of XML modeling.
Contents Topic: page
Functional overview 2
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 easier 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
2
Chapter 1. XML Model Basics
Demo models
Demo XML models are available in the Examples directory.
About XML
Why use XML? The eXtensible Markup Language is used for different reasons:
♦ It describes and structures data, whereas HTML only displays data
3
What is an XML model?
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:
4
Chapter 1. XML Model Basics
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
5
What is an XML model?
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:
6
Chapter 1. XML Model Basics
You can use several diagrams to have partial views of a complex diagram.
7
What is an XML model?
Any
All
No link
Any
No link
No link
No link
8
Chapter 1. XML Model Basics
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.
9
Defining the XML model environment
10
Chapter 1. XML Model Basics
Share To use the shared XML language stored in the XML Lan-
guages directory of your installation. Any changes made to
the XML language are available to the linked XML model
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.
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.
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:
12
Chapter 1. XML Model Basics
Option Description
13
Defining the XML model environment
run the check model feature to verify if the model does not contain any
duplicate object.
Enable links to Requirements are descriptions of customer needs that must be satisfied
requirements 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 .
Naming conventions You can also set naming conventions for each type of objects in your model.
+ For information on naming conventions, see section Defining naming
conventions, from chapter Managing Models, in the General Features Guide
.
14
Chapter 1. XML Model Basics
2. Select or clear the Name/Code case sensitive check box in the All Objects
groupbox.
3. Click OK.
15
Defining an XML model
16
Chapter 1. XML Model Basics
If you want to display the XML language, click the Properties tool beside
the XML language box in the General 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 meaning-
ful, 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
File name Location of the model file. This box is empty if the model
has never been saved
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
17
Defining an XML model
Property Description
Target Names- Namespace of all the model objects. Its name is a URI
pace which does not refer to any file but only to an assigned
name. A prefix can be assigned to the namespace. All
the schema elements with this prefix in their start-tag
will be associated with the namespace. For example:
http://www.mycompany.com/myproduct/XMLmodel
18
Chapter 1. XML Model Basics
The Items page of the model property sheet displays the list of global objects
(with no parent symbol in the diagram, directly linked to the <schema> tag)
created in the model. This list reflects the order in which global objects are
being declared in the schema. If you want to change this order of
declaration, you must select an item in the list and use the arrowed buttons,
at the bottom-left corner of the page, to move the selected item in the list:
Up one page
Up one line
You can also use the Items page to create global objects in the model:
19
Defining an XML model
20
Chapter 1. XML Model Basics
21
Defining an XML model
The Preview page of the model property sheet displays a preview of the
XSD, DTD or XDR file generated from the XML model.
Example of an XSD file (or schema file):
22
Chapter 1. XML Model Basics
The schema file starts with the XML declaration followed by the <schema>
(root element) declaration.
All objects created in the model will appear in the schema file between the
schema start-tag and end-tag.
When you create a new XML model using the New model option, you have
to select an XML language.
23
Defining an XML model
Option 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
the other models. The XML language is saved with the model
and cannot be used by other models
4. 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.
5. Select an XML language from the XML language dropdown listbox of
the General page.
6. Select either Share or Copy.
7. <optional> If you want to attach one or more extended model definitions
to the model, click the Extended Model Definitions tab, and select the
extended model definitions of your choice.
24
Chapter 1. XML Model Basics
Creating an XML model using the New model from template option
25
Defining an XML model
v To create a new XML model using the New model from template
option
1. Select File ä New to display the New dialog box.
3. Select the New model from template radio button in the upper right part
of the dialog box to display the Template page.
List of templates
You can select user-defined model templates (use the Change User-
Defined Model Templates Folder tool to specify the user templates
folder) and copy some existing models as model templates using the
Copy Model to User-Defined Model Templates Folder tool.
+ For more information on model templates, see section Creating a
model in chapter Managing Models, in the General Features Guide.
5. Click OK.
A new XML model is created in the Workspace.
6. Select Model ä Model Properties.
or
Right-click any empty space in the diagram window and select Properties
from the contextual menu.
The model property sheet appears.
7. Type a name and a code for the model.
8. Click OK.
26
Chapter 1. XML Model Basics
27
Defining an XML model
If it is the first time you save an XML model, a standard Windows Save As
dialog box appears: Type a file name, choose a folder in your directory and
click Save.
Closing an XML model To close an XML model, choose one of the following options:
28
CHAPTER 2
About this chapter This chapter describes how to build an XML model (XSM). It explains the
role of each object in an XML model and how to create and modify them.
Contents Topic: page
Defining elements 33
29
XML diagram basics
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.
If an XML model is too large or too complex, you can create several
diagrams to have partial views of the model and focus on certain objects.
The following example displays the Achievement diagram of the Resume
XML model:
30
Chapter 2. Building an XML model
The original diagram of the Resume XML model being too large (see first
picture), it has been split into five diagrams (Main, Contact, Achievement,
Description and Address) corresponding to the five main objects of the
model.
31
XML diagram basics
32
Chapter 2. Building an XML model
Defining elements
Elements are the basic building blocks of an XML model.
An XML model is a tree structure of elements where child elements are
attached to parent elements.
For example (Browser tree view and diagram):
Generated schema:
33
Defining elements
34
Chapter 2. Building an XML model
Parent elements are linked to their child elements through group particles
(sequence, choice or all). A parent element can contain a group of child
elements (See Group type in the following table)
You can derive an element data type to extend or restrict its values. (Only
with a model targeted with XSD)
The General page of an element property sheet displays the following
properties:
Property Description
Name The name of the item which should be clear and meaning-
ful, 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
35
Defining elements
Property Description
Group type Indicator that specifies how child elements are to be used
within the parent element. It can be a group particle (all,
choice, sequence) or a group of elements (group). If
you select group, a referencing group is directly linked to
the current element (see “Defining group properties” on
page 77)
36
Chapter 2. Building an XML model
37
Defining elements
Property Description
Substitution group Name of a global element for which the current element
can be substituted. It must have the same type or a
derived type. Its value must be a qualified name (See
Glossary)
38
Chapter 2. Building an XML model
Property Description
In the case of a model targeted with XDR, the Detail page is only available
for local elements.
39
Defining elements
You can access directly to the Attributes page of an element property sheet
through the contextual menu. Right-click an element symbol in the diagram
and select Attributes in the contextual menu.
Identity constraints allow you to indicate that element values must be unique
within their specified scope.
You can use the Constraints page of an element property sheet to add the
following constraints to an element declaration:
40
Chapter 2. Building an XML model
You can access directly to the Constraints page of an element property sheet
through the contextual menu. Right-click an element symbol in the diagram
and select Constraints in the contextual menu.
+ For more information on constraints, see section “Defining identity
constraints” on page 64.
41
Defining elements
Creating an element
You can create an element:
♦ From the palette
♦ From the Browser tree view
♦ From the List of Elements of the Model menu
+ For more information on the different ways to create an element, see
section Creating an object in chapter Managing objects of the General
Features Guide .
42
Chapter 2. Building an XML model
7. Click OK.
The element symbol appears in the diagram, with its data type (between
brackets) right under its name.
43
Defining elements
44
Chapter 2. Building an XML model
Pointer indications
When you cannot click a symbol or an empty space in a diagram, the
Pointer displays a forbidden sign (See complex type in Tool column).
When there is a possibility to create a symbol above, below or next to
another one, the Pointer displays an arrow indicating the corresponding
direction (See elements in Tool column).
45
Defining elements
Generated schema:
46
Chapter 2. Building an XML model
You can derive an attribute data type to extend or restrict its values. (Only
with a model targeted with XSD)
To display an attribute property sheet, double-click its name or its icon in the
Browser tree view.
The General page of an attribute property sheet displays the following
properties:
Property Description
Name The name of the item which should be clear and meaning-
ful, 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
47
Defining elements
Property Description
Defining attributes in In a model targeted with the XML-Data Reduced language, attributes tags
XDR files are defined by different attributes:
48
Chapter 2. Building an XML model
49
Defining elements
Property Description
50
Chapter 2. Building an XML model
or
Click an empty row in the list.
4. Type a name and a code for the attribute.
5. Click OK.
The element symbol appears in the diagram with the attribute name. In
the example, <None> indicates that no data type has been defined for the
attribute.
51
Defining elements
Preference Description
Element Attributes Select Type, if you want the attributes data types to be
displayed
+ For more information on XPath expressions, see section “Defining an
identity constraint selector” on page 70.
Group particles indicate how child elements are related with their parent
element.
You can choose a group particle from the following list:
52
Chapter 2. Building an XML model
Sequence seq
Choice one
All many
Extract of an XDR file:
53
Defining elements
Property Description
Type Type of the group particle. You can change its type by
selecting a value in the dropdown listbox and clicking OK
54
Chapter 2. Building an XML model
3. Click an empty space in the diagram, to deselect the element symbol, and
click the Expand tab (+) to reveal the group particle symbol and its link
with the element symbol.
Note the Collapse tab (-) on the right side of the element symbol. If you
click it, the group particle symbol and its link are replaced by an Expand
tab (+).
Click the Expand tab (+) to recover the group particle symbol and its link.
4. Double-click the group particle symbol to display the group particle
property sheet.
5. Select the Items page to display a list of items.
6. Click the Add Element tool for each child element you create in the list.
or
Click an empty row in the list for each child element you want to create.
7. Click OK.
The group particle symbol appears selected, with an Expand tab on its
right side.
55
Defining elements
56
Chapter 2. Building an XML model
XML objects do not support standard link objects. To link a child object to a
group particle, you must click the child object tool in the palette and then
click the group particle symbol in the diagram. This will automatically
create a link between both objects. See the following table for allowed links:
Caution
A group particle cannot be created from scratch in a diagram. It must be
the child element of an element, a group or a complex type.
No link
Any
No link
A referencing group A referencing group
is created. You must is created. You must
now select a group now select a group
for the reference for the reference
No link
No link
57
Defining elements
Pointer indications
When you cannot click a symbol or an empty space in a diagram, the
Pointer displays a forbidden sign (See complex type in Tool column).
When there is a possibility to create a symbol above, below or next to
another one, the Pointer displays an arrow indicating the corresponding
direction (See element in Tool column).
58
Chapter 2. Building an XML model
The General page of an Any property sheet displays the following properties:
Property Description
59
Defining elements
v To create an Any
1. Select the Any tool in the palette.
2. Click a choice or a sequence symbol in the diagram.
The Any symbol appears in the diagram attached to the choice or
sequence symbol.
6. Click OK.
60
Chapter 2. Building an XML model
Caution
Any Attribute only appears in a schema (see the Preview page of a model
property sheet).
The Any Attribute feature is available via a check box in the bottom-left
corner of an Attributes page.
61
Defining elements
To display an Any Attribute property sheet, select the Any Attribute check
box and then click the Properties tool.
The General page of an Any Attribute property sheet displays the following
properties:
62
Chapter 2. Building an XML model
Property Description
63
Defining identity constraints
Generated schema:
64
Chapter 2. Building an XML model
Property Description
65
Defining identity constraints
For example:
Generated schema:
The KEYCODE key constraint, defined on the project element, specifies that
the code attribute must be unique, not null and always present within the
product element.
To display a key property sheet, double-click its name or its icon in the
Browser tree view.
The General page of a key property sheet displays the following properties:
66
Chapter 2. Building an XML model
Property Description
The Fields page of a key property sheet displays a list of XPath expressions.
If there is more than one field (or XPath expression), the combination of
fields must be unique.
+ For more information on XPath expressions, see section “Defining an
identity constraint selector” on page 70.
67
Defining identity constraints
Generated schema:
68
Chapter 2. Building an XML model
Property Description
69
Defining identity constraints
70
Chapter 2. Building an XML model
You can use the following abbreviated syntax to define an XPath expression:
Syntax Description
71
Defining identity constraints
Syntax Description
72
Chapter 2. Building an XML model
Property Description
2. Click Apply.
3. Click the Properties tool beside the XPath box.
The selector property sheet appears.
4. Define the selector properties in the different pages of the property sheet.
5. Click OK.
73
Defining identity constraints
The General page of a field property sheet displays the following properties:
Property Description
74
Chapter 2. Building an XML model
6. Define the field properties in the different pages of the property sheet.
7. Click OK.
75
Defining groups
Defining groups
You can define groups of elements or attributes in an XML model.
76
Chapter 2. Building an XML model
♦ In the generated DTD file, the group is expanded directly within its
parent element:
♦ In the generated XDR file, the group is declared through a <group> tag,
within an <ElementType> tag with its order attribute set to seq:
77
Defining groups
Property Description
Group type Indicator that specifies how child elements are to be used
within the group. Select a group particle (all, choice or
sequence)
78
Chapter 2. Building an XML model
Once you have defined the reference of a referencing group, you can locate
the referenced group in the diagram by right-clicking the referencing group
symbol and selecting Find Referenced Group in the contextual menu. The
referenced group appears with handles in the diagram.
You can access directly to the Preview page of a group property sheet.
Right-click a group (or a referencing group) symbol in the diagram and
select Preview in the contextual menu.
79
Defining groups
6. Click OK.
7. Select a group particle tool in the palette (Sequence, Choice or All).
80
Chapter 2. Building an XML model
81
Defining groups
82
Chapter 2. Building an XML model
Pointer indications
When you cannot click a symbol or an empty space in a diagram, the
Pointer displays a forbidden sign (See complex type in Tool column).
When there is a possibility to create a symbol above, below or next to
another one, the Pointer displays an arrow indicating the corresponding
direction (See element in Tool column).
83
Defining groups
To display an attribute group property sheet, double-click its name or its icon
in the Browser tree view.
Attribute group general There are global and referencing attribute groups:
properties
♦ Global attribute groups are defined with the Model menu. In a schema,
they are directly linked to the <schema> tag (root element). They can be
reused for any element, complex type or attribute group in the model
through references (See quality attribute group in the generated schema)
♦ Referencing attribute groups are used within an element, a complex type
or an attribute group definition. For this, you must use the attribute group
tools in the Attributes page of an element, a complex type or an attribute
group property sheet
The General page of an attribute group property sheet displays the following
properties:
84
Chapter 2. Building an XML model
Property Description
85
Defining groups
86
Chapter 2. Building an XML model
4. Click OK.
5. Select the Attributes page.
6. Select different tools to add items to the attribute group.
7. Click Apply.
8. Double-click on the left of a row to display an item property sheet.
9. Type a name and a code for the item.
10. Repeat steps 8 and 9 for each item.
11. Click OK.
87
Managing external shortcuts through references and data types
88
Chapter 2. Building an XML model
89
Defining simple types
90
Chapter 2. Building an XML model
properties:
Property Description
Derivation Derivation method for the simple type. Enabled and required
when the simple type is defined
91
Defining simple types
4. Click OK.
The simple type symbol appears in the diagram.
Caution
If the simple type symbol does not appear in the diagram, select Show
Symbols in the Symbol menu, then click the Simple Type tab and select
the simple type box to display its symbol in the diagram.
92
Chapter 2. Building an XML model
Caution
Global complex types appear in the model as objects, with their corre-
sponding symbol in the diagram. Local complex types only appear in the
schema (see Preview page of an element property sheet).
93
Defining complex types
The General page of a complex type property sheet displays the following
properties:
Property Description
Group type Indicator that specifies how child elements are to be used
within the complex type. It can be a group particle (all,
choice, sequence) or a group of elements (group). If you
select group, a referencing group is directly linked to the
complex type (See “Defining group properties” on page 77)
Derivation Derivation method for the complex type. Once you have
selected a derivation method, you must define a base
type. Click the Properties tool beside the derivation box to
display the derivation property sheet. In the General page,
select a base type in the Base Type dropdown listbox
The Detail page of a complex type property sheet displays the following
properties:
94
Chapter 2. Building an XML model
Property Description
Abstract If selected, this property indicates that the complex type can
be used in the instance document
95
Defining complex types
You can access directly to the Attributes page of a complex type property
sheet through the contextual menu. Right-click a complex type symbol in
the diagram and select Attributes in the contextual menu.
96
Chapter 2. Building an XML model
abstract data types (in PDMs) or classes (in OOMs) to the current complex
type.
You can use the Add Objects tool to select abstract data types or classes
from the PDMs or OOMs opened in the current workspace.
Attributes Mapping page The Attributes Mapping page allows you to define the mapping between
abstract data type attributes (in PDMs) or class attributes (in OOMs) and
attributes in the current complex type.
97
Defining complex types
Preference Description
Complex Type Select Type, if you want the complex type attributes data
Attributes types to be displayed
+ For more information on the different ways to create a complex type, see
section Creating an object in chapter Managing objects of the General
Features Guide .
98
Chapter 2. Building an XML model
6. Click OK.
7. Select a group particle tool in the palette (Sequence, Choice or All).
99
Defining complex types
100
Chapter 2. Building an XML model
Pointer indications
When you cannot click a symbol or an empty space in a diagram, the
Pointer displays a forbidden sign (See complex type in Tool column).
When there is a possibility to create a symbol above, below or next to
another one, the Pointer displays an arrow indicating the corresponding
direction (See element in Tool column).
101
Defining complex types
5. Click OK.
Property Description
102
Chapter 2. Building an XML model
4. Type an ID for the complex content and check the Mixed box, if needed.
5. Click OK.
103
Defining derivations
Defining derivations
You use derivations when you want to extend or restrict the values of simple
and complex types.
An XML model allows you to derive:
♦ Simple types by restriction, list or union
Deriving by extension
You derive a complex type by extension when you want to extend the values
of its base type.
For example:
104
Chapter 2. Building an XML model
Defining extension The General page of an extension property sheet displays the following
general properties properties:
Property Description
2. Click Apply.
3. Click the Properties tool beside the Derivation box.
The extension property sheet appears.
4. Type an ID and select a base type.
105
Defining derivations
5. Click OK.
Deriving by restriction
You derive a simple type or a complex type by restriction when you want to
restrict the values of their base type.
♦ Detail
♦ Enumerations
♦ Patterns
Detail, Enumerations and Patterns pages are described in the next section,
Defining restriction facets.
Restriction general The General page of a simple type restriction property sheet displays the
properties following properties:
106
Chapter 2. Building an XML model
Property Description
Embedded type If selected, the base type disappears and a simple type is
created in the schema within the current simple type
107
Defining derivations
Caution
Facets only appear in the schema, within a simple type declaration (see
Preview tab in the model property sheet).
Facet general properties The General page of a facet property sheet displays the following properties:
Property Description
108
Chapter 2. Building an XML model
Generated schema:
Restriction patterns The Patterns page of a simple type restriction property sheet allows you to
properties enter the exact sequence of acceptable values for the simple type restriction.
Select F (for Fixed) at the end of a row if you want to prevent the
modification of a value.
For example: the zipCode simple type, based on the xs:string data type, is
restricted to the following pattern: two uppercase letters, from A to Z,
followed by a five-digit number, each digit ranging from 0 to 9.
109
Defining derivations
Generated schema:
You derive a simple type by restriction when you want to restrict the values
of its base type.
110
Chapter 2. Building an XML model
3. Click Apply.
4. Click the Properties tool beside the Derivation box.
The restriction property sheet appears.
5. Type an ID and a base type for the simple type restriction.
111
Defining derivations
If you select Embedded type, the base type disappears and a simple type
is created in the schema within the current simple type. Click Apply, and
then the Properties tool beside the Embedded type box, to define a
derivation and a base type for the embedded simple type.
112
Chapter 2. Building an XML model
8. Click Apply.
9. Click the Properties tool beside the facet box.
The facet property sheet appears (the length property sheet in the
example).
113
Defining derivations
The General page of a complex type restriction property sheet displays the
following properties:
Property Description
114
Chapter 2. Building an XML model
2. Click Apply.
3. Click the Properties tool beside the Derivation box.
The restriction property sheet appears.
4. Type an ID and a base type for the complex type restriction.
5. Click OK.
Deriving by list
You derive a simple type by list when you want to define it as a list of values
of a specified data type.
The General page of a simple type list property sheet displays the following
properties:
Property Description
115
Defining derivations
If you select Embedded type, the type disappears and a simple type is
created in the schema within the current simple type. Click Apply, and
then the Properties tool beside the Embedded type box, to define a
derivation and a type for the embedded simple type.
5. Click OK.
Deriving by union
You derive a simple type by union when you want to define it as a collection
of built-in and simple data types.
Union general properties The General page of a simple type union property sheet displays the
following properties:
116
Chapter 2. Building an XML model
Property Description
5. Click OK.
117
Defining annotations
Defining annotations
You define annotations when you want to add information about an XML
model.
Annotations are made of Documentation and Application Information:
♦ Documentation allows you to write a URI reference or any well-formed
XML content that will give extra information about XML objects or
documents
♦ Application Information allows you to write a URI reference or any
well-formed XML content that will be used by applications for
processing instructions
There are two kinds of annotations:
♦ Local annotations, for extra information on XML objects. You can define
them through the Annotation page of an object property sheet. They have
no property sheet
♦ Global annotations, for extra information on XML models or schemas.
You can define them through the Items page or the External Schemas
page of a model property sheet. They have a property sheet
Generated schema of a global annotation:
118
Chapter 2. Building an XML model
The Items page of an annotation property sheet displays a list where you can
add the following items:
Local annotations
The Annotation page of an object property sheet displays the same items
list. The ID box allows you to give an id to the local annotation. Its
value must be of type ID and unique within the model containing the local
annotation.
119
Defining annotations
Property Description
Documentation content
The Content page of a documentation (or an application information)
property sheet allows you to write or paste any well-formed XML content.
Creating an annotation
You can create a global annotation from the Items page or the External
Schemas page of a model property sheet.
120
Chapter 2. Building an XML model
7. Click OK.
121
Defining notations
Defining notations
Notations allow you to define and process non-XML objects within an XML
model.
For example: picture files with a .GIF extension.
Generated schema:
Property Description
122
Chapter 2. Building an XML model
Creating a notation
You can create a notation:
♦ From the Browser tree view
4. Click OK.
123
Defining entities
Defining entities
Entities enable you to include predefined values, external XML or non-XML
files in an XML model targeted with a DTD.
When an XML processor reads an entity reference in an XML document, it
will replace this entity reference by its value defined in the DTD file of the
XML document.
An entity reference is the entity name preceded by an ampersand and
followed by a semicolon.
For example: &glossary; will be replaced by See Glossary.
The W3C has predefined five entities for XML tags:
Apostrophe ' ‘
Quotation " ”
In an XML model, you just need to type the name and the value of an entity.
Property Description
124
Chapter 2. Building an XML model
Property Description
Creating an entity
You can create an entity:
♦ From the Browser tree view
♦ From the List of Entities in the Model menu
125
Defining entities
5. Click OK.
126
Chapter 2. Building an XML model
Defining an import
An import identifies a namespace whose schema components are referenced
by the current schema.
With an import, you can use schema components from any schema with
different target namespace than the current schema.
In a schema, an import is declared with the <import> tag.
For example:
To display an import property sheet, double-click its name or its icon in the
Browser tree view.
Import general properties The General page of an import property sheet displays the following
properties:
127
Defining import, include and redefine
Property Description
Schema location URI reference for the location of a schema file with
an external namespace. You can use the Browse tool
beside the Properties tool to select a schema file among
those opened in the current workspace. For example:
ORDER.xsd
Creating an import
128
Chapter 2. Building an XML model
4. Click OK.
Defining an include
An include allows you to include a specified schema file in the target
namespace of the current schema.
With an include, you can use schema components from any schema with the
same target namespace as the current schema or with no specified target
namespace.
In a schema, an include is declared with the <include> tag.
For example:
129
Defining import, include and redefine
To display an include property sheet, double-click its name or its icon in the
Browser tree view.
Include general The General page of an include property sheet displays the following
properties properties:
Property Description
Schema loca- URI reference for the location of a schema file with the
tion same target namespace or no specified target namespace.
You can use the Browse tool beside the Properties tool to
select a schema file among those opened in the current
workspace. For example: PROFORMA.xsd
Creating an include
130
Chapter 2. Building an XML model
4. Click OK.
Defining a redefine
A redefine allows you to redefine simple and complex types, groups and
attribute groups from an external schema file in the current schema.
With a redefine, you can use schema components from any schema with the
same target namespace as the current schema or with no specified target
namespace.
In a schema, a redefine is declared with the <redefine> tag.
For example:
131
Defining import, include and redefine
To display a redefine property sheet, double-click its name or its icon in the
Browser tree view.
Redefine general The General page of a redefine property sheet displays the following
properties properties:
Property Description
Schema location URI reference for the location of a schema file with the
same target namespace or no specified target namespace.
You can use the Browse tool beside the Properties tool to
select a schema file among those opened in the current
workspace. For example: customers.xsd
Creating a redefine
132
Chapter 2. Building an XML model
4. Click OK.
133
Defining business rules
The General page of a business rule property sheet displays the following
properties:
Property Description
134
Chapter 2. Building an XML model
Formula Calculation used in the XML The total order is the sum of
model all the order line costs
135
Defining business rules
4. Click Apply.
5. Double click the arrow at the beginning of the line.
The business rule property sheet appears.
6. In the General page, select a business rule type in the Type dropdown
listbox.
136
Chapter 2. Building an XML model
7. Click OK.
137
Defining business rules
3. Click the Add Rules tool to display the list of business rules.
The Selection window appears. It contains a list of all the business rules
of the model, with the exception of those that already belong to the object.
138
Chapter 2. Building an XML model
6. Click OK.
139
CHAPTER 3
About this chapter This chapter describes how you can work with an XML model and how you
can generate an XML model from a PDM or an OOM.
When building an XML model, you can check the validity of your model at
any time, with the Check Model feature. You can also map XML objects to
PDM or OOM objects, merge XML models and edit reports.
Contents Topic: page
141
Checking an XML model
You can identify the level of problem severity with the following tool:
To display the severity level options, select Tools ä Check Model, then
expand the nodes of the tree view in the options tab.
These messages represent two different levels of problem severity. You can
modify the level of problem severity for each object parameter verified by
the Check model. This severity level can depend on the degree of
normalization you want to achieve in your model.
142
Chapter 3. Working with an XML model
Automatic correction
You can specify if you want PowerDesigner to automatically correct an error
using the Automatic Correction feature.
However, before using automatic correction, make sure you understand how
it will affect your model.
Automatic correction is not available for all object parameters. Problems
that cannot be corrected automatically must be corrected manually.
+ For more information on objects available for automatic correction, see
section “XML Model objects verified by Check Model” on page 148.
143
Checking an XML model
144
Chapter 3. Working with an XML model
9. Clear check boxes for objects that you do not want to be checked.
145
Checking an XML model
146
Chapter 3. Working with an XML model
Contextual menu
When you right click an object parameter, a menu appears listing the
correction options: Manual Correction, Help, Check again, and Automatic
Correction. You can also select options to clear, dock and hide the result
window.
5. Right-click the object parameter and select Check again from the
contextual menu.
Verify that the problem has been corrected by running Check Model
again.
147
XML Model objects verified by Check Model
Existence of particle
A group particle must contain elements, groups, group particles and/or Any.
Invalid cardinality
Model check
This check only applies to models built on a schema.
148
Chapter 3. Working with an XML model
Identifier uniqueness
Undefined identifier
You must define an identifier (ID) for each object in the model.
Two shortcuts with the same code cannot be in the same namespace.
Missing namespaces
Type a URI and a prefix in the Names- Adds the target namespace URI and
paces page of the model property sheet a prefix “ns” followed by a number
(e.g. “ns1”)
149
XML Model objects verified by Check Model
A model cannot contain two business rules with identical names and/or
codes.
There cannot be two data sources with identical names and/or codes in a
model.
Rename one of the data sources Renames the data source by ap-
pending a number to its name or
code
Existence of model
A data source must have at least one model in its definition.
150
Chapter 3. Working with an XML model
Add a model from the Models page of Deletes data source without a
the data source property sheet model
Data source containing models with different Object Language or DBMS types
File check
During a file check, the following object controls are made.
Entity check
During an entity check, the following object controls are made.
A model cannot contain two entities with identical names and/or codes.
151
XML Model objects verified by Check Model
Undefined entity
You must define an entity. In the entity property sheet, you must either type
a value (string of characters or URI) in the Value box, or a URI in the Public
or System boxes.
Include check
During an include check, the following object control is made.
A model cannot contain two simple types with identical names and/or codes.
Rename one of the simple types Renames the simple type by ap-
pending a number to its name or
code
152
Chapter 3. Working with an XML model
A model cannot contain two complex types with identical names and/or
codes.
Existence of attribute
A complex type should have at least one attribute.
Existence of particle
A complex type must contain elements, groups, group particles and/or Any.
Element check
During an element check, the following object controls are made.
A model cannot contain two elements with identical names and/or codes.
153
XML Model objects verified by Check Model
Undefined type
Undefined reference
An element without a defined data type must have a reference.
Existence of attribute
An element without a reference, a data type or a substitution group should
have at least one attribute.
Existence of particle
Invalid cardinality
154
Chapter 3. Working with an XML model
Group check
During a group check, the following object controls are made.
A model cannot contain two groups with identical names and/or codes.
Undefined reference
A group without a name or a code must have a reference.
Existence of particle
Invalid cardinality
155
XML Model objects verified by Check Model
Attribute check
During an attribute check, the following object controls are made.
The parent of an attribute cannot contain two attributes with identical names
and/or codes.
Undefined reference
An attribute without a name or a code must have a reference.
Undefined type
Notation check
During a notation check, the following object controls are made.
156
Chapter 3. Working with an XML model
A model cannot contain two notations with identical names and/or codes.
Undefined notation
A notation must have at least one URI defined for Public or System
properties.
A model cannot contain two attribute groups with identical names and/or
codes.
Undefined reference
An attribute group without a name or a code must have a reference.
157
XML Model objects verified by Check Model
Existence of attributes
An attribute group must contain at least one attribute.
Import check
During an import check, the following object control is made.
Redefine check
During a redefine check, the following object controls are made.
Existence of component
A redefine must contain at least one of the following items: simple type,
complex type, group or attribute group.
158
Chapter 3. Working with an XML model
Key check
During a key check, the following object controls are made.
An element cannot contain two keys with identical names and/or codes.
Existence of fields
A key must contain at least one field.
Undefined selector
You must define an XPath expression for a key selector attribute.
KeyRef check
During a keyRef check, the following object controls are made.
159
XML Model objects verified by Check Model
An element cannot contain two keyRefs with identical names and/or codes.
Undefined reference
A keyRef must contain a reference to a key or a unique constraint.
Existence of fields
A keyRef must contain at least one field.
Undefined selector
You must define an XPath expression for a keyRef selector attribute.
160
Chapter 3. Working with an XML model
Unique check
During a unique constraint check, the following object controls are made.
Existence of fields
A unique constraint must contain at least one field.
Add at least one field to the unique Deletes unassigned unique con-
constraint or delete the unique con- straint
straint. For example: @numEmployee
+ For more information on fields, see section Defining an identity
constraint field in chapter Building an XML model.
Undefined Selector
You must define an XPath expression for a unique constraint selector
attribute.
161
XML Model objects verified by Check Model
Modify the duplicate extended ob- Modifies the extended object name or
ject name/code code of a selected object by appending
a number to its current name or code
Modify the duplicate extended link Modifies the extended link name or
name/code code of a selected object by appending
a number to its current name or code
Replication check
During a replication check, the following object control is made.
Extension check
During an extension check, the following object control is made.
You must define a base type when you derive a complex type by extension.
162
Chapter 3. Working with an XML model
Restriction check
During a restriction check, the following object controls are made.
You must define a base type when you derive a simple or a complex type by
restriction.
Existence of facet
A simple type restriction must have at least one facet defined. Facets are
defined in the Detail, Enumerations and Patterns pages of a simple type
restriction property sheet.
You must define a base type when you derive a simple type by list.
163
XML Model objects verified by Check Model
You must define at least two data types when you derive a simple type by
union.
Annotation check
During an annotation check, the following object control is made.
Existence of items
An annotation must contain at least one URI for a Documentation or an
Application Information.
164
Chapter 3. Working with an XML model
To display a data source property sheet, double-click its name or its icon in
the Browser tree view.
165
Mapping objects in an XML model
Data source general The General page of a data source property sheet displays the following
properties 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 data source
You can create as many data sources as you need in a model. Each data
source defines the list of models used as source of data in the current model.
166
Chapter 3. Working with an XML model
6. In the General page, select a model type in the Model Type dropdown
listbox.
7. In the Models page, click the Add Models tool.
A model selection dialog box appears. Select the model(s) for the current
data source.
8. Click OK in each of the dialog boxes.
The data source appears in the Browser tree view.
167
Mapping objects in an XML model
Create Mapping Creates a mapping for a data source that you can
further define using the queries sub-tabs located
at the bottom part of the dialog box. By default,
you are prompted to create a data source the
first time you click the Create Mapping tool.
Then, you have to declare one or more source
models in order to select source objects from a
selection list. If child objects match, they are
automatically mapped. Each time you click the
Create Mapping tool for the current object, it
creates a new mapping.
Delete Current Deletes the current mapping for the data source.
Mapping
168
Chapter 3. Working with an XML model
Mapping elements
169
Mapping objects in an XML model
170
Chapter 3. Working with an XML model
Mapping elements
171
Mapping objects in an XML model
+ For more information about the different tools in the toolbar, see the
“Mapping Editor” chapter in the General Features Guide.
+ For more information about the Attributes Mapping page, see section
““Mapping elements” on page 169”.
Caution
You cannot create a mapping for an XML object if you have not
previously defined a data source containing at least one source model.
To define a data source, see section Defining data sources in an XML
model.
3. In the Element Sources sub-tab, click the Add Objects tool to select the
source tables you want to map to the current element and click OK.
The name and code of the tables appear in the list.
172
Chapter 3. Working with an XML model
4. Click the Attributes Mapping sub-tab and click the Add Mapping tool in
the toolbar.
173
Mapping objects in an XML model
7. Click the Criteria sub-tab if you want to specify join criteria between the
source tables or views.
8. Click the Select sub-tab if you want to visualize or modify the entire
statement.
9. Click OK.
174
Chapter 3. Working with an XML model
expression has not been modified by the user, the content of the Mapped To
box in the General page is updated.
3. Click the Sources sub-tab and click the Add Sources tool to select source
columns or attributes from a selection dialog box and click OK.
The columns or attributes appear in the Sources list.
4. Click the General tab to display the corresponding tab. The selected
columns or attributes appear in the “Mapped to” box.
5. Click OK.
175
Manipulating XML objects graphically
Local objects
You can move local objects within or between the Browser tree view and the
diagram window.
Move
Select Tools ä General Options to make sure that Move is the Default
action of the Drag & Drop option.
Within Browser You can move a local object within the Browser to convert it into a global
object. If the new global object does not appear in the diagram, select
Symbol ä Show Symbols and click the corresponding tab to select the new
global object
Within diagram You can move a local object within the diagram to another group particle. It
remains a local object, but with a new parent object.
You cannot move a local object within the diagram to convert it into a global
object. It remains attached to its group particle.
From Browser to diagram When you move a local object from the Browser to the diagram, a synonym
is created, attached to the same group particle as the original symbol.
From diagram to Browser You can move a local object from the diagram to the Browser, and convert it
into a global object. If the new global object does not appear in the diagram,
select Symbol ä Show Symbols and click the corresponding tab to select the
new global object
Global objects
You can move global objects within or between the Browser tree view and
the diagram window.
176
Chapter 3. Working with an XML model
Move
Select Tools ä General Options to make sure that Move is the Default
action of the Drag & Drop option.
Within Browser You can move a global object within the Browser to convert it into a local
object (under a group particle item), but you cannot move a global object
within its own structure (as a child of itself).
Within diagram You can move a global object within the diagram to convert it into a local
object. Just move the global object symbol to a group particle symbol.
From Browser to diagram When you move a global object from the Browser to the diagram, a
synonym symbol is created in the diagram.
From diagram to Browser You can move a global object from the diagram to the Browser, and convert
it into a local object (under a group particle item). If the new local object
does not appear in the diagram, double-click the Collapse node of the group
particle symbol under which the former global object has been attached.
177
Manipulating XML objects graphically
After conversions
178
Chapter 3. Working with an XML model
179
Generating an XML model from a Physical Data Model
View Element
Key Key
Index Unique
180
Chapter 3. Working with an XML model
Select Symbol ä Show Symbols to reveal the other generated XML Model
objects (simple types and complex types).
Generate new XML You must indicate the following parameters when you generate a new XML
model model:
Parameter Description
Configure Model It lets you define the model options for the new
Options XML model. You can select the naming conventions
corresponding to the target language for example
+ For more information on model options when generating an XML model
from a PDM, see “Defining XML model generation options” on page 182.
Update existing XML You can generate a PDM into an existing XML model.
model
If you choose to update an existing XML model when the current PDM has
never been generated, the Select model dropdown listbox is empty by
181
Generating an XML model from a Physical Data Model
default. You have to click the Ellipsis button to display the Select a model
dialog box in which you can select a model. The Workspace Location and
Physical Path columns provide more information about the model location in
the workspace and the file path to help you choose the XML model. You can
also use the tooltip in the dropdown listbox to verify the location and path of
the model.
To update an existing XML model, you must indicate the following
parameters:
Parameter Description
182
Chapter 3. Working with an XML model
Option Description
Check model When selected, it verifies the model before generating the
XML model, and stops generation if an error is found
Convert names When selected, object codes are generated from names
into codes using the corresponding conversion script. This is use-
ful when generating models with very different naming
conventions. With this option selected, both objects will
have their codes generated from their names. If you do not
select this option, generated object codes will be copied
from original object codes
Generate map- When selected, allows to define the current PDM as the
ping data source of the generated XML model and to create
object correspondence between PDM and XML model
183
Generating an XML model from a Physical Data Model
3. Type a name and a code for the new XML model, otherwise it will have
184
Chapter 3. Working with an XML model
9. Select the check boxes for the objects you want to generate, and clear the
check boxes for the objects you do not want to generate.
10. Click OK.
The Output window shows the progress of the generation process. The
new XML model diagram appears in the work area.
185
Generating an XML model from a Physical Data Model
If the Preserve modifications check box is not selected, the existing model is
replaced.
You can only generate an XML model from the active PDM diagram
window.
186
Chapter 3. Working with an XML model
Preserve modifications
Select the Preserve modifications check box if you want to preserve
objects in the XML model. If you clear this check box, all existing
objects in the XML model will be removed from the model, leaving
only the objects generated from the PDM.
5. Click the Target Models tab to select the target models of shortcuts in the
current model.
8. Select the check boxes for the objects you want to generate, and clear the
check boxes for the objects you do not want to generate.
9. Click OK.
If you selected the Preserve modifications check box, the Merge Models
window appears.
If you cleared the Preserve modifications check box, the updated XML
model diagram appears in the work area.
Merging models
The Merge Models dialog box shows the newly generated XML model
in the left pane, and the existing XML model in the right pane. You
can select or clear object check boxes in the right pane for XML model
objects that you want to include or delete in the model to be merged.
+ For more information on merging models, see Comparing and
Merging Models in the General Features Guide .
187
Generating an XML model from an Object-Oriented Model
Identifier Key
188
Chapter 3. Working with an XML model
Parameter Description
Configure Model Op- It lets you define the model options for the new
tions XML model. You can select the naming con-
ventions corresponding to the target language for
example
+ For more information on model options when generating an XML model
from an OOM, see “Defining XML model generation options” on page 190.
Update existing XML You can generate an OOM into an existing XML model.
model
If you choose to update an existing XML model when the current OOM has
never been generated, the Select model dropdown listbox is empty by
default. You have to click the Ellipsis button to display the Select a model
dialog box in which you can select a model. The Workspace Location and
189
Generating an XML model from an Object-Oriented Model
Physical Path columns provide more information about the model location in
the workspace and the file path to help you choose the XML model. You can
also use the tooltip in the dropdown listbox to verify the location and path of
the model.
To update an existing XML model, you must indicate the following
parameters:
Parameter Description
190
Chapter 3. Working with an XML model
Option Description
Check model When selected, it verifies the model before generating the
XML model, and stops generation if an error is found
Convert names When selected, object codes are generated from names
into codes using the corresponding conversion script. This is use-
ful when generating models with very different naming
conventions. With this option selected, both objects will
have their codes generated from their names. If you do not
select this option, generated object codes will be copied
from original object codes
Generate map- When selected, allows to define the current OOM as the
ping data source of the generated XML model and to create
object correspondence between OOM and XML model
191
Generating an XML model from an Object-Oriented Model
3. Type a name and a code for the new XML model, otherwise it will have
192
Chapter 3. Working with an XML model
9. Select the check boxes for the objects you want to generate, and clear the
check boxes for the objects you do not want to generate.
10. Click OK.
The Output window shows the progress of the generation process. The
new XML model diagram appears in the work area.
193
Generating an XML model from an Object-Oriented Model
If the Preserve modifications check box is not selected, the existing model is
replaced.
You can only generate an XML model from the active OOM diagram
window.
194
Chapter 3. Working with an XML model
Preserve modifications
Select the Preserve modifications check box if you want to preserve
objects in the XML model. If you clear this check box, all existing
objects in the XML model will be removed from the model, leaving
only the objects generated from the OOM.
5. Click the Target Models tab to select the target models of shortcuts in the
current model.
8. Select the check boxes for the objects you want to generate, and clear the
check boxes for the objects you do not want to generate.
9. Click OK.
If you selected the Preserve modifications check box, the Merge Models
window appears.
If you cleared the Preserve modifications check box, the updated XML
model diagram appears in the work area.
Merging models
The Merge Models dialog box shows the newly generated XML model
in the left pane, and the existing XML model in the right pane. You
can select or clear object check boxes in the right pane for XML model
objects that you want to include or delete in the model to be merged.
+ For more information on merging models, see Comparing and
Merging Models in the General Features Guide .
195
Editing an XML model report
Option Description
196
Chapter 3. Working with an XML model
197
Editing an XML model report
Language in a template
When you use a template created in a language different from the one
you select to create your report, only user-defined items such as Title or
Text paragraph will keep the language of the template. Other items will
be displayed in the report language.
6. Click OK.
The Report Editor window appears. A section is created by default at the
bottom of the Report items pane, which is filled with the template you
have selected. If you did not select a template, the Report items pane is
empty. Simultaneously a report node appears under the Reports category
in the Browser.
+ For more information on the Report Editor, see chapter Using the
Report Editors in the Reports User’s Guide .
198
Chapter 3. Working with an XML model
To have a preview of your report, click the Print Preview tool in the Report
Editor window.
199
CHAPTER 4
About this chapter This chapter describes how to generate and reverse engineer an XML
Schema Definition file (.XSD), a Document Type Definition file (.DTD) or
an XML-Data Reduced file (.XDR).
The same procedures apply to all XML languages.
Contents Topic: page
201
Generating an XSD, a DTD or an XDR file
File preview
You can have a preview of an XSD, a DTD or an XDR file by clicking the
Preview tab of an XML model property sheet.
Check model
You can check your model before generation if you select the Check model
check box. This check box is available for all XML languages. The
202
Chapter 4. Generating and reverse engineering an XSD, a DTD or
an XDR file
generation stops if an error is found. You must correct this error before
starting the generation again.
For more information on the Check model feature, see section Checking an
XML model in chapter Working with an XML model.
When you start the generation process, you can choose to:
♦ Generate for a selected XML language
♦ Use an extended model definition (.XEM) that extends the XML language
To use an extended model definition that extends the XML language, you
must have an extended model definition attached to the model. You can
either create a new extended model definition or import an existing extended
model definition in the model.
For more information on how to create or import an extended model
definition, see sections Creating an extended model definition, or Importing
an extended model definition into a model, in chapter Extended Model
Definitions Reference Guide in the Advanced User Documentation .
If you use an extended model definition to extend the XML language, you
must use an extended model definition designed for this kind of generation.
To do this, you must verify that the value Complement Language Generation
is selected in the extended model definition editor.
When you attach an extended model definition to your model, the Targets
page in the Generation dialog box displays the target extended model
definition that can be selected for generation.
+ For more information on the generation targets, see section Generation
targets, in chapter Extended Model Definitions Reference Guide, in the
Advanced User Documentation .
If you do not see the Options page in the Generation dialog box, it means
that no option has been defined in the corresponding XML language (.XSL
file).
You can however customize your XML language at any time, and add any
options you may need during generation. You define generation options in
the Generation/Options category of the XML language available from
Language ä Edit Current Language.
203
Generating an XSD, a DTD or an XDR file
If the Generation category does not appear, right-click the name or the icon
of the XML language in the tree view, and select Add Items in the contextual
menu. In the Categories list of the Selection dialog box, select Generation
and click OK. Right-click the Generation category and select New ä Option
in the contextual menu.
The Tasks page contains standard commands defined in the XML language.
You can select any tasks to execute at generation time.
If you do not see the Tasks page in the Generation dialog box, it means that
no command has been defined in the corresponding XML language (.XSL
file).
You can however customize tasks for your current language. You define
generation tasks and commands in the Generation/Tasks category and the
Generation/Commands category of the XML language available from
Language ä Edit Current Language.
If the Generation category does not appear, right-click the name or the icon
of the XML language in the tree view, and select Add Items in the contextual
menu. In the Categories list of the Selection dialog box, select Generation
and click OK. Right-click the Generation category and select New ä Task in
the contextual menu.
204
Chapter 4. Generating and reverse engineering an XSD, a DTD or
an XDR file
In the case of an XDR file, the Generation dialog box displays an Options
page where the generation of comments (see Comment property in the
General page of an object property sheet) is set by default. If you do not
want a commentary to appear in the generated XDR file (within a
<description> tag), you can set the Value to false.
205
Generating an XSD, a DTD or an XDR file
3. <optional> Select the Check model check box if you want to verify the
validity of your model before generation.
4. Click OK.
A Result box appears indicating that the XSD, DTD or XDR file has been
generated in the destination directory.
The result is also displayed in the Generation page of the Output window,
located in the bottom part of the main window.
206
Chapter 4. Generating and reverse engineering an XSD, a DTD or
an XDR file
5. Click Edit to edit the XSD, DTD or XDR file with a plain text editor.
207
Reverse engineering an XSD, a DTD or an XDR file
Parsing
PowerDesigner uses a parser software for XML reverse engineering,
developed by the Apache Software Foundation (http://www.apache.org/).
The Options page of the Reverse Engineering dialog box displays the
following options:
208
Chapter 4. Generating and reverse engineering an XSD, a DTD or
an XDR file
Option Description
Show complex types If selected, the complex types appear in the dia-
gram. Only with XSD files
Show simple types If selected, the simple types appear in the diagram.
Only with XSD files
The Target Models page of the Reverse Engineering dialog box displays a
list for target models. Select the Add Models tool if you want to maintain the
shortcuts defined between the XSD, DTD or XDR file you are reverse
engineering and other XML models.
209
Reverse engineering an XSD, a DTD or an XDR file
6. In the Options page, click the Select a File tool beside the File name box
to select the XSD, DTD or XDR file you want to reverse engineer.
210
Chapter 4. Generating and reverse engineering an XSD, a DTD or
an XDR file
7. In the Target Models page, select the Add Models tool if you want to
maintain the shortcuts defined between the XSD, DTD or XDR file you
are reverse engineering and other XML models.
A Selection dialog box appears with a list of XML models.
211
Reverse engineering an XSD, a DTD or an XDR file
6. In the Target Models page, select the Add Models tool if you want to
maintain the shortcuts defined between the XSD, DTD or XDR file you
are reverse engineering and other XML models.
A Selection dialog box appears with a list of XML models.
7. Select the XML models you want to attach as target models.
212
Chapter 4. Generating and reverse engineering an XSD, a DTD or
an XDR file
8. Click OK.
The Merge Models dialog box appears, with the newly generated XML
model in the left pane, and the existing XML model in the right pane.
You can select or clear object check boxes in the right pane for objects
that you want to include or delete in the model to be merged.
Auto-layout
Select Symbol ä Auto-Layout to help you display the new diagram.
213
CHAPTER 5
About this chapter This chapter describes how to use an XML model to store or retrieve data in
databases supporting XML.
Contents Topic: page
215
Why use XML in databases?
216
Chapter 5. Exchanging data with databases supporting XML
♦ Manually
The best way to map an XML model to a PDM is to use the XML Builder
Wizard.
If you do not have a PDM, you can reverse engineer a database into a PDM.
+ For more information on reverse engineering a database into a PDM, see
chapter Reverse engineering in a PDM, in the PDM User’s Guide .
Caution
The following procedure assumes you have a PDM open in the workspace
and targeted with Microsoft SQL Server 2000 as DBMS. If the PDM is
not targeted with the proper DBMS, select Database ä Change Current
DBMS.
217
Generating an annotated schema for Microsoft SQL Server 2000
2. Select the new model option. Type a name and a code for the new model,
and select XML Schema Definition 1.0 or XML-Data Reduced 1.0 in the
XML language dropdown listbox.
or
Select the existing model option. Select a model in the XML Model
dropdown listbox. This model must be targeted with XSD or XDR.
3. Click Next.
The Tables and Views Selection dialog box appears with the PDM tables
list.
218
Chapter 5. Exchanging data with databases supporting XML
4. <optional> Click the Deselect All tool and select the tables you want to
generate into XML elements.
5. Click Next.
The XML Hierarchy Design dialog box appears. By default, the XML
hierarchy corresponding to the PDM appears in the right pane.
You can use the Properties tool to display the property sheet of the table
selected in the left pane. The second tool allows you to add the selected
object to the selected position in the XML model hierarchy. The last tool
allows you to add to the XML model an object with the objects it is
related to.
219
Generating an annotated schema for Microsoft SQL Server 2000
220
Chapter 5. Exchanging data with databases supporting XML
221
Generating an annotated schema for Microsoft SQL Server 2000
Note: In the General Purpose page, you can select the XML Document
extended model definition to generate a simplified XML file that will help
you understand the annotated schema.
222
Chapter 5. Exchanging data with databases supporting XML
15. Click the Select a Path button, beside the Directory box, to select a path
for the annotated schema file.
16. Click OK.
The Result dialog box appears with the path of the annotated schema file
selected.
223
Generating an annotated schema for Microsoft SQL Server 2000
Note the SQL namespace (with the sql prefix) and the SQL annotations
for tables (sql:relation), columns (sql:field) and reference
(sql:relationship).
18. Click Close in the Result dialog box.
224
Chapter 5. Exchanging data with databases supporting XML
Caution
The following procedure assumes you have an XML model open in the
workspace, targeted with XSD or XDR, mapped with a PDM, and linked
to the Microsoft SQL Server extended model definition. (See “Mapping
XML objects to PDM objects” on page 217)
You can define a value for the following annotations regarding an element
(E) and/or an attribute (A):
225
Generating an annotated schema for Microsoft SQL Server 2000
Annotation E A Description
226
Chapter 5. Exchanging data with databases supporting XML
Annotation E A Description
3. Click OK.
4. Repeat steps 1 to 3 for each element or attribute you want to map with a
database table or column, or for which you want to define extra
annotations.
5. Select Language ä Generate XML Schema Definition File.
or
Select Language ä Generate XML-Data Reduced File.
The Generation dialog box appears with Microsoft SQL Server selected
in the Targets page.
227
Generating an annotated schema for Microsoft SQL Server 2000
6. Click the Select a Path button, beside the Directory box, to select a path
for the annotated schema file.
7. Click OK.
The Result dialog box appears with the path of the annotated schema file
selected.
8. Click Edit.
The annotated schema appears in the editor window.
228
Chapter 5. Exchanging data with databases supporting XML
Note the SQL namespace (with the sql prefix) and the SQL annotations
for tables (sql:relation), columns (sql:field) and reference
(sql:relationship).
9. Click Close in the Result dialog box.
229
Generating an annotated schema for Oracle 9i2
Caution
The following procedure assumes you have an XML model open in the
workspace and targeted with XSD.
230
Chapter 5. Exchanging data with databases supporting XML
4. Click OK.
Oracle XML DB 9.2 appears in the List of Extended Model Definitions.
5. Click OK.
The extended model definition appears in the Browser tree view, in a
folder attached to the XML model.
231
Generating an annotated schema for Oracle 9i2
Annotation Description
232
Chapter 5. Exchanging data with databases supporting XML
Annotation Description
8. Click OK.
9. Repeat steps 6 to 8 for each element you want to generate into a table or a
column, or for which you want to define extra annotations.
10. Double-click a complex type symbol in the diagram to display its
233
Generating an annotated schema for Oracle 9i2
property sheet.
11. In the Extended Attributes page, type the name of an abstract data type
(ADT) in the Value column of the SQLType annotation, if you want to
create an ADT from the selected complex type.
Annotation Description
234
Chapter 5. Exchanging data with databases supporting XML
14. <optional> In the Browser tree view, double-click the model item to
display its property sheet.
15. In the Extended Attributes page, you can select a value (false or true) for
the following annotations:
Annotation Description
235
Generating an annotated schema for Oracle 9i2
18. Select a path for the annotated schema with the Select a Path tool beside
the Directory box.
19. Click OK.
The Result dialog box appears with the path of the generated schema file.
Note the Oracle namespace (with the sql prefix) and annotations for
tables (sql:SQLName) and ADTs (sql:SQLType)
21. Click Close in the Result dialog box.
236
Chapter 5. Exchanging data with databases supporting XML
Caution
The following procedure assumes you have a PDM open in the workspace
and targeted with IBM DB2 UDB 8.x Common Server as DBMS. If the
PDM is not targeted with the proper DBMS, select Database ä Change
Current DBMS.
237
Generating a DAD file for IBM DB2
2. Select the new model option. Type a name and a code for the new model,
and select Document Type Definition 1.0 in the XML language
dropdown listbox.
or
Select the existing model option. Select a model in the XML Model
dropdown listbox. This model must be targeted with DTD.
3. Click Next.
The Tables and Views Selection dialog box appears with the PDM tables
list.
238
Chapter 5. Exchanging data with databases supporting XML
4. <Optional> Click the Deselect All tool and select the tables you want to
generate into XML elements.
5. Click Next.
The XML Hierarchy Design dialog box appears. By default, the XML
hierarchy corresponding to the PDM appears in the right pane.
You can use the Properties tool to display the property sheet of the table
selected in the left pane. The second tool allows you to add the selected
object to the selected position in the XML model hierarchy. The last tool
allows you to add to the XML model an object with the objects it is
related to.
239
Generating a DAD file for IBM DB2
240
Chapter 5. Exchanging data with databases supporting XML
241
Generating a DAD file for IBM DB2
Note: In the General Purpose page, you can select the XML Document
extended model definition to generate a simplified XML file that will help
you understand the annotated schema.
12. Click OK in the Extended Model Definition Selection dialog box.
242
Chapter 5. Exchanging data with databases supporting XML
15. In the Extended Attributes page, click the DB2XMLExtender tab and
select a value for the StorageType (Xcollection or Xcolumn). In the case
of an Xcollection, select a value for the MappingType (RDB or SQL).
243
Generating a DAD file for IBM DB2
17. Repeat steps 14 to 16 for each global element you want to determine the
type of DAD file or other extended attributes.
244
Chapter 5. Exchanging data with databases supporting XML
Note: The DAD files will be generated simultaneously with the DTD file
and a SQL file for stored procedures.
19. <optional> In the Options page, generation options are set by default.
You can change their value.
245
Generating a DAD file for IBM DB2
Option Description
20. Click the Select a Path button, beside the Directory box, to select a path
for the DAD, DTD and SQL files.
21. Click OK.
The Result dialog box appears with the paths of the generated DAD,
DTD and SQL files.
246
Chapter 5. Exchanging data with databases supporting XML
247
Generating a DAD file for IBM DB2
248
Chapter 5. Exchanging data with databases supporting XML
Caution
The following procedure assumes you have an XML model open in the
workspace and mapped to a PDM.
249
Generating SQL/XML queries
4. Click OK.
SQL/XML appears in the List of Extended Model Definitions.
5. Click OK.
The SQL/XML extended model definition appears in the Browser tree
view, attached to the model.
250
Chapter 5. Exchanging data with databases supporting XML
6. < optional > Double-click a global element in the diagram to display its
property sheet.
The Preview page is in read-only mode, you cannot modify the script.
8. Click OK.
9. Select Tools ä Extended Generation.
The Generation dialog box appears with SQL/XML selected in the
Targets page.
251
Generating SQL/XML queries
10. Click the Select a Path button beside the Directory box to select a path
for the SQL/XML queries.
11. In the Selection page, select the global elements for which you want to
generate a SQL/XML query. (Only one global element in the example)
252
Chapter 5. Exchanging data with databases supporting XML
253
Generating SQL/XML queries
254
CHAPTER 6
About this chapter This chapter describes how to generate an XML model from an XML model.
Contents Topic: page
255
Generation basics
Generation basics
You can generate an XML model from an XML model.
+ For more information on model to model generation common features,
see the “Linking and Synchronizing Models in PowerDesigner” chapter in
the General Features Guide .
256
Chapter 6. Generating Other Models from an XSM
Parameter Description
Copy XML language for the resulting XML model. It uses a copy
of the XML language stored in the XML Languages library
Configure It lets you define the model options for the new XML model
Model Options
+ For more information, see the “Linking and Synchronizing Models in
PowerDesigner” chapter in the General Features Guide .
257
Generating an XML model from an XML model
Option Description
Check model When selected, verifies the model before generating the
XML model, and stops generation if an error is found
Save generation When selected, PowerDesigner keeps track of the identity
dependencies of the origin of each generated object. It is useful when
merging two XML models which have been generated
from the same XML model. Objects can be compared
and recognized as the same object, even if the object has
been modified in the merged XML model. If not selected,
origin objects have no link with generated objects
Enable transfor- This button is used to activate transformations during
mations generation. When you click this button, the Pre-generation
tab appears if the source model contains transformations.
You can select the transformations to execute before
generation. The Extended Model Definitions tab also
appears for you to select extended model definition files
to attach to the generated model. These files may contain
post-generation transformations, in this case, the Post-
Generation tab appears to let you select the transformations
you want to be executed in the generated model. If
the generation is an update, and the generated model
contains extended model definitions with post-generation
transformations, the Post-generation tab automatically
appears as soon as you click the Enable Transformations
button
258
CHAPTER 7
all A group particle indicating that child elements can appear in any order, each
of them once or not
annotation Additional information about a model and its objects proceeding from
documentation and/or applications
any Allows you to attach any type of object to a choice or a sequence group
particle
any attribute Allows you to insert any attribute of specified namespaces into an element, a
complex type or an attribute group
attribute Additional information about an element or a complex type
attribute group A set of attributes that can be incorporated into an element, a complex type
or another attribute group, with only the reference of its name
business rule A written statement specifying what an XML model must contain or how it
must be structured to support business needs
character data In a schema or a DTD, all text that is not markup and that will not be parsed
choice A group particle indicating that only one child element can be linked to its
parent element
complex type A data type definition to determine the attributes and child elements of a
parent element
complex content Allows you to extend or restrict the values of a complex type with mixed
content or elements only
derivation Used to extend or restrict the values of simple types and complex types
DTD Document Type Definition. An XML language defining the content of an
XML file with a list of legal elements
element The basic building block of an XML model
embedded type Locally defined data type. For an object encapsulated into another object
entity Enables you to include predefined values, external XML or non-XML files
(URL values) in an XML model defined with a DTD
259
extension Derivation of a complex type to extend the values of its base type
facet A constraint on the set of values of a simple type
field An XPath expression that specifies the value (or one of the values) used to
define an identity constraint (unique, key or keyRef)
global object A global object has a global scope. It has no parent object and can be reused
locally in the model through referenced objects. In a schema, it is directly
linked to the <schema> root element
group A set of elements arranged by a group particle (all, choice or sequence)
group particle An indication (all, choice, sequence) on how child elements are related with
their parent element
ID Identifier (key word) for a model object. It must be unique within the model.
To be XML-valid, it must start by an underscore or a letter, followed by
alphanumeric characters
identity constraint An indication to specify that element or attribute values must be unique
within their specified scopes
import Identifies a namespace whose schema components are referenced by the
current schema
include Allows you to include a specified schema file in the target namespace of the
current schema
key An identity constraint to specify that an element or attribute value (or set of
values) must be a key within a specified scope. A key means that data should
be unique, not null and always present within a specified scope
keyRef An identity constraint to specify that an element or attribute value (or set of
values) corresponds to those of a specified key or unique constraint
list Derivation of a simple type to restrict its values to a list of values of a
specified data type
local object A local object has a local scope, within a parent object. It cannot be reused
elsewhere in the model
namespace Original location for the definition of an object. It should be a URI
no-colon name A name without a colon (:), beginning with a letter or an underscore
(NCName) character, and followed by any combination of characters
notation Allows you to describe the format of non-XML data within an XML model
qualified name (QName) A name beginning with a prefix and a colon (:). The prefix is associated with
a namespace URI. For example: xs:schema, xs being associated with
http://www.w3.org/2001/XMLSchema
260
Chapter 7. XML Model Glossary
261
unique An identity constraint used to specify that an element or attribute value (or
set of values) must be unique or null within a specified scope
URI Uniform Resource Identifier. A string of characters which identifies an
Internet resource
XDR XML-Data Reduced. An XML language defining the structure of an XML
file. It is a simplified XSD (or schema)
XML Extensible Markup Language. Used for structuring documents with
self-describing tags in plain text format
XML language Language used to define the structure of an XML model. It can be
Document Type Definition 1.0 or XML Schema Definition 1.0
XPath XML Path Language. A language to address parts of an XML document
+ For more information on XPath, see XPath abbreviated syntax in section
Defining an identity constraint selector, in chapter Building an XML model
XSD XML Schema Definition (or schema). An XML language defining the
structure of an XML file. It supports namespaces and datatypes
262
Index
263
Index
264
Index
265
Index
XPath 74 I
file check 151
IBM DB2 237
final 17, 38, 90, 94
identity constraint 64
fixed 38, 49, 107
create identity constraint 69
form 38, 49
field 74
fraction digits 106
key 65
functional overview 2
keyRef 67
G selector 70
unique 64
generate 256 import 127
basics 256 check 158
check model 182, 258 create import 128
check model parameter 202 namespace 127
DTD file from XML model 202 schema location 127
enable transformations 182, 190, 258 include 129
model options 258 check 152
model options from OOM 190 create include 130
model options from PDM 182 schema location 129
new XML model from OOM 192
new XML model from PDM 184 K
OOM to XML model 188
key 40, 65
options parameter 202
check 159
PDM to XML model 180
field 65
preserve modifications 181, 185, 189, 193, 257
properties 65
targets parameter 202
selector 65
tasks parameter 202
stereotype 65
updated XML model from OOM 193
keyRef 40, 67
updated XML model from PDM 185
check 159
XDR file from XML model 202
field 67
XML language 181, 189, 257
properties 67
XML model to XML model 257
reference 67
XSD file from XML model 202
selector 67
global objects 176
stereotype 67
group 52, 76
check 155
L
create group 79
properties 76 length 106
reference 76 level of problem severity
stereotype 76 error 142
group particle 52 warning 142
all 52 link 7, 43, 57, 81, 100
check 148 child object to complex type 100
choice 52 child object to element 43
create group particle 55 child object to group 81
properties 53 child object to group particle 57
sequence 52 child object to parent object 7
group symbols 31 local objects 176
266
Index
267
Index
268
Index
ElementType 34
XML 3
diagram 30
model 3
objects 5
XML language 10, 257
change XML language 11
choose XML language 26
XPath 74
abbreviated syntax 70
expressions 70
XSD 3
269