Defining identity constraints

Syntax

Description

/book/chapter[2]/section[3]

Selects the third section in the second chapter of

 

the book

employee[@dept=”doc”]

Selects all the employee child elements of the

 

context node with a dept attribute set to doc

employee[@dept=”doc”][3]

Selects the third employee child element of the

 

context node with a dept attribute set to doc

employee[3][@dept=”doc”]

Selects the third employee child element of the

 

context node only if it has a dept attribute set to

 

doc

chapter[title]

Selects the chapter child elements of the context

 

node with at least one title child element

chapter[title=”About this

Selects the chapter child elements of the context

book”]

node with at least one title child element with a

 

text content set to About this book

employee[@numEmployee and

Selects all the employee child elements of the

@dept]

context node with the numEmployee and dept

 

attributes

text()

Selects all the child nodes of the text context

 

node

 

 

Defining selector general properties

The General page of a selector property sheet displays the following properties:

Property

Description

XPath

An XPath expression relative to the parent element being

 

declared. It identifies the child elements to which the identity

 

constraint applies

Stereotype

Sub-classification used to extend the semantics of an object

 

without changing its structure. It can be predefined or user-

 

defined

ID

ID of the selector. Its value must be of type ID and unique within

 

the model containing the selector

 

 

™To display a selector property sheet:

1Type an XPath expression in the Selector groupbox of an identity constraint (unique, key or keyRef) property sheet.

72

PowerDesigner

Page 84
Image 84
Sybase XML manual Defining selector general properties, ™ To display a selector property sheet