Databases Reference
In-Depth Information
account_operation
bankAccN
account_operation
bankAccN
“0012”
id
id
“00025”
request
number
request
number
“10”
date
date
04-20-2007
?
means
means
Internet
?
notes
notes
urgent
+
opertion
opertion
type
type
bank transfer
amount
amount
$ 1,500
recipient
recipient
0023
or
?
notes
Invoice 315 of
03-31-2007
notes
value
(a) DTD tree
(b) XML document tree
Fig. 2. An example of graphical representation of DTD and XML document
A path expression on a document tree is a sequence of element names
or predefined functions separated by character / (slash): l 1 /l 2 /.../l n . Path
expressions may terminate with an attribute name as the last term of
the sequence. Attribute names are syntactically distinguished by preceding
them with special character @ . A path expression l 1 /l 2 /.../l n on a docu-
ment tree represents all the attributes or elements named l n that can be
reached by descending the document tree along the sequence of nodes named
l 1 /l 2 /.../l n− 1 . A path expression can be either absolute , if it starts from the
root of the document (the path expression starts with / ); or relative ,ifit
starts from a predefined element in the document (the path expression starts
with element name). The path expression may also contain operators (e.g.,
operator . represents the current node, operator .. represents the parent
node, operator // represents an arbitrary descending path), functions, and
predicates (we refer the reader to [3] for more details).
XPath allows the association of conditions with nodes in a path; in this
case the path expression identifies the set of nodes that satisfy all the condi-
tions. Conditional expressions in XPath may operate on the “text” of elements
(i.e., character data in elements) or on names and values of attributes. A con-
dition is represented by enclosing it within square brackets, following a label
l i in a path expression l 1 /l 2 /.../l n . The condition is composed of one or more
predicates, which may be combined via and and or boolean operators. Each
predicate compares the result of the evaluation of the relative path expres-
sion (evaluated at l i ) with a constant or with another expression. Multiple
conditional expressions appearing in the same path expression are considered
to be and ed (i.e., all the conditions must be satisfied). In addition, condi-
tional expressions may include functions last() and position() that permit
Search WWH ::




Custom Search