validation steps. Moreover, the constraint definition
is totally disconnected from the type definition.
In this paper, we present eqCXSD, for extended
quantified Constraints in XML Schema Definition, a
more complete solution capable to express quanti-
fied and conditional constraints on any element or
set of elements. We extend a classical ”integrated”
XML solution, W3C XML schema format (Thomp-
son et al., 2001), with constraint quantification and
conditional content constraints. The constraint quan-
tification is made thanks to a quantifier added to the
element concerned by the constraint. It expresses how
much occurences of the element is concerned by the
constraint. The proposed extension is made in the
same Schema to keep the coherence between the ele-
ment structure definition and its constraints.
We first present the expressiveness of XML
schemas. Second, we present extended constraints
on XML elements. Third, we introduce our new ex-
tended formalism. Fourth, we present the XML trans-
lation in W3C XML Schema of our new formalism.
2 XML SCHEMAS AND THEIR
EXPRESSIVENESS
An XML document can been seen as an unranked or-
dered and labelled tree composed of simple or com-
plex elements. The general structure of the doc-
ument and its elements definition are given in its
schema. This schema essentially describes structural
constraints on XML documents. There are several
schemas formalisms, the most known and used are
W3C XML Schema (Thompson et al., 2001) and Re-
lax NG (Clark and Murata, 2001). Each of them
have different constraint mechanisms and expressive-
ness. A detailed description and comparison of these
schema languages can be found in (Murata et al.,
2005; Lee and Chu, 2000). In (Mani and Lee, 2002),
the authors have proposed a new formalism, called
XSchema, which matches with XML Schemas.
Definition 1 (Mani and Lee, 2002). An XSchema is
a 6-tuple X = (E,A,M,P,r,Σ) where :
• E is a finite set of element names,
• A is a function from an element name e ∈ E to
a set of attribute names a,
• M is a function from an element name e ∈ E to
its element type definition α where α is
α ::= ε | τ | α + α | α,α | α
∗
| α
?
| α
+
where ε denotes the empty element, τ is an
atomic data type (e.g., String, Integer, ...), ”+”
the union, ”,” the concatenation, α
∗
for the
Kleene star, α
?
for (α + ε) and α
+
for (α , α
∗
),
• P is a function from an attribute name a to its
attribute definition β = (τ,n,d, f ) where n is ei-
ther nullable or not nullable, d is a finite set of
valid domain values of a (that can be ε) and f a
default value of a (that can be ε),
• r ⊆ E is a finite set of root elements,
• Σ is a finite set of integrity constraints. These
constraints concern ID and IDREF elements
and represent XML keys and foreign keys.
To illustrate the notions presented in this article,
we use a case study concerning the selection of can-
didates in a Master program. These candidates are
represented by their XML Curriculum Vitae. The fol-
lowing example shows a XSchema corresponding to a
part of our case study. We represent the candidate ex-
perience with its scholar experiences, its professional
experiences and its competencies.
Example 1 : G
1
= (E, A, M, P, r,Σ) is a XSchema.
• E ={Experience, Diploma, Degree, Year,
Mark, Field, Professional, Competence, Type}
• M = {Experience 7−→ (Diploma+, Profes-
sional*, Competence*);
Diploma 7−→ (Degree, Year, Mark, Field);
Degree 7−→ String; Year 7−→ Integer;
Mark 7−→ float; Field 7−→ String;
Professional, Competence 7−→ (Type, Field);
Type 7−→ String}
• r ={Experience}
• A,P, Σ =
/
0
G1 defines the expected structure of a CV. E is
the set of all the element names. Their definition
are expressed in M. A complex type definition is
composed of subelements, like Experience which is
composed by at least one Diploma and several or no
Pro f essional and Competence. A simple type defini-
tion is an atomic data type, like Mark which is a float.
Experience is the root element (r). For the sake of
simplicity, this example contains no attribute.
XSchema can express integrity constraints and
simple constraints of different kinds that are listed in
the taxonomy of figure 1.
Figure 1: A classification of XML simple constraints
In addition to these constraints, W3C XML
Schema manages content constraints as Enumeration,
Domain range checking and Pattern matching. In
this language, a constraint is applied to a simple type
ICAART 2009 - International Conference on Agents and Artificial Intelligence
262