W3C home > Mailing lists > Public > xmlschema-dev@w3.org > April 2003

Re: Content Constraints in Table Rows

From: Henry S. Thompson <ht@cogsci.ed.ac.uk>
Date: 15 Apr 2003 10:51:59 +0100
To: <daniel.brauer2@img-online.de>
Cc: <xmlschema-dev@w3c.org>
Message-ID: <f5bk7dw6qbk.fsf@erasmus.inf.ed.ac.uk>

"Daniel Brauer" <daniel.brauer2@img-online.de> writes:

> So is it possible to define a single type "Row" type with an attribute like
> "position" which can be "first"/"middle"/"last" and use it to check the
> content?

The literal answer is "no", computed types/co-constraints are not
supported in general.  If you don't mind using the name "xsi:type"
(with an appropriate namespace) instead of "position", then you can do
this.  Define types called 'first', 'middle' and 'last', then define
<row> to have a type definition which subsumes all of them, and write
e.g.

 <tableName xmlns:xsi="http://www.w3.org/2001/XMLSchema">
  <row xsi:type="first">
  . . .
  </row>
  <row xsi:type="middle">
  . . .

ht
-- 
  Henry S. Thompson, HCRC Language Technology Group, University of Edinburgh
                      Half-time member of W3C Team
     2 Buccleuch Place, Edinburgh EH8 9LW, SCOTLAND -- (44) 131 650-4440
	    Fax: (44) 131 650-4587, e-mail: ht@cogsci.ed.ac.uk
		     URL: http://www.ltg.ed.ac.uk/~ht/
 [mail really from me _always_ has this .sig -- mail without it is forged spam]
Received on Tuesday, 15 April 2003 05:52:01 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 11 January 2011 00:14:36 GMT