"Henry S. Thompson" wrote: > Eddie Robertsson <eddie@allette.com.au> writes: > > > > 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 . . . > > Um, depends on exactly what was meant, but > > <xs:choice> > <xs:element name='dateDispatched' . . ./> > <xs:element name='dateDelivered' . . ./> > </xs:choice> > > should do the job. Yes, but I got the impression that both elements should always be present but only one of them should contain a value and the other should be empty. For example these to instances would be valid: <test> <dateDispatched>2001-11-30</dateDispatched> <dateDelivered></dateDelivered> </test> <test> <dateDispatched></dateDispatched> <dateDelivered>2001-11-30</dateDelivered> </test> But the following two would be invalid: <test> <dateDispatched>2001-11-30</dateDispatched> <dateDelivered>2001-11-30</dateDelivered> </test> <test> <dateDispatched></dateDispatched> <dateDelivered></dateDelivered> </test> Cheers, /EddieReceived on Friday, 30 November 2001 21:56:15 GMT
This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 11 January 2011 00:14:25 GMT