In the past few years, a number of constraint languages for XML documents has been proposed. They are cumulatively called schema languages or validation languages and they comprise, among others, DTD, XML Schema, RELAX NG, Schematron, DSD, xlinkit. One major point of discrimination among schema languages is the support of co-constraints, or co-occurrence constraints, e.g., requiring that attribute A is present if and only if attribute B is (or is not) presentin the same element. Although there is no way in XML Schema to express these requirements, they are in fact frequently used in many XML document types, usually only expressed in plain human-readable text, and validated by means of special code modules by the relevant applications. In this paper we propose SchemaPath, a light extension of XML Schema to handle conditional constraints on XML documents. Two new constructs have been added to XML Schema: conditions -- based on XPath patterns -- on type assignments for elements and attributes; and a new simple type, xsd:error, for the direct expression of negative constraints (e.g. it is prohibited for attribute A to be present if attribute B is also present). A proof-of-concept implementation is provided. A Web interface is publicly accessible for experiments and assessments of the real expressiveness of the proposed extension.
[1]
not Cwi,et al.
XHTML™ 1.0 The Extensible HyperText Markup Language
,
2002
.
[2]
C. M. Sperberg-McQueen,et al.
eXtensible Markup Language (XML) 1.0 (Second Edition)
,
2000
.
[3]
C. M. Sperberg-McQueen,et al.
Extensible Markup Language (XML)
,
1997,
World Wide Web J..
[4]
Licia Capra,et al.
xlinkit: a consistency checking and smart link generation service
,
2002,
TOIT.
[5]
Eric van der Vlist,et al.
Relax NG
,
2003
.
[6]
Philip Wadler,et al.
The essence of XML
,
2003,
POPL '03.
[7]
C. M. Sperberg-McQueen,et al.
Extensible markup language
,
1997
.
[8]
Fabio Vitali,et al.
Datatype- and namespace-aware DTDs: A minimal extension
,
2003,
Extreme Markup Languages®.
[9]
Steven J. DeRose,et al.
Xml linking language (xlink), version 1. 0
,
2000,
WWW 2000.
[10]
Nils Klarlund,et al.
DSD: A schema language for XML
,
2000,
FMSP '00.
[11]
Frank Pfenning,et al.
Dependent types in practical programming
,
1999,
POPL '99.
[12]
Steven J. DeRose,et al.
XML linking
,
1999,
CSUR.
[13]
Arvind Malhotra,et al.
Xml schema part 2: datatypes
,
1999
.