W3C home > Mailing lists > Public > xmlschema-dev@w3.org > November 2001

Re: only one of the element is req but not both...

From: Eddie Robertsson <eddie@allette.com.au>
Date: Wed, 28 Nov 2001 20:48:29 +1100
Message-ID: <3C04B2ED.53CA7A2E@allette.com.au>
To: "Hanumaiahgari, Srinivas" <Srinivas.Hanumaiahgari@dva.gov.au>
CC: "'xmlschema-dev@w3.org'" <xmlschema-dev@w3.org>
> 1.I got 'dateDispatched' and 'dateDelivered' in my schema and i want to
> check wherein one of them is required but not both and the other should be
> empty.

You can't do this with W3C XML Schema alone but with embedded Schematron rules
it would be trivial. See [1] for an example.

> 2. Can i perform calculations in schema..
> its something like..can i set a field called 'TotalLines' empty to begin
> with,and then sum the lines received in xml doc and hence fill the above
> later.

No, this has to be done in the application.

Cheers,
/Eddie

[1] http://lists.w3.org/Archives/Public/xmlschema-dev/2001Nov/0049.html
Received on Wednesday, 28 November 2001 04:42:29 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Sunday, 6 December 2009 18:13:35 GMT