- From: Ayalew Kassahun <A.Kassahun@InfoRay.NL>
- Date: Thu, 22 Mar 2001 13:09:05 +0100
- To: xmlschema-dev@w3.org
- Cc: Morris Matsa <mmatsa@us.ibm.com>
This solution works with simple cases like this but doesn't work if PART has child elements of different types? > -----Original Message----- > From: Morris Matsa [mailto:mmatsa@us.ibm.com] > Sent: Tuesday, March 20, 2001 6:11 PM > To: Ayalew Kassahun > Cc: xmlschema-dev@w3.org; ht@cogsci.ed.ac.uk > Subject: RE: Is this valid schema?? > > > > > The two <PART> elements can not have different types. What I > think you can > do is specify the value of the PART element's NAME attribute to be an > enumeration of "HEADER" and "CONTENT" so that those are the > only allowed > values, and then use a <unique> element (in the schema) to > make sure that > each only appears once in the <result> element. Finally, > your schema just > says that a <result> must have two <part> elements, and each > must have a > unique attribute for the NAME attribute, which only has two > possibilities. > > As far as I can tell, the only difference between this and > your ideal is > that HEADER and CONTENT can appear in either order. If you > want them in > only one order, you can't do that with Schemas yet. Just document it. > Sorry. > > Morris > > > Ayalew Kassahun <A.Kassahun@InfoRay.NL>@w3.org on 03/20/2001 > 11:42:18 AM > > Sent by: xmlschema-dev-request@w3.org > > > To: xmlschema-dev@w3.org > cc: ht@cogsci.ed.ac.uk > Subject: RE: Is this valid schema?? > > > > But that is exactly what I want to have (ok to same effect), how do I > specify that? > What I mean is I want to have > <RESPONSE> > <RESULT> > <PART NAME="HEADER"> > <PART NAME="CONTENT"> > <EXTRA> > </RESULT> > </RESPONSE> > > whereby the PART's (of which i have a long list) should > always have the > given attribute and attribute-value (fixed) and each occur only once. > > thanks in advance for any suggestions, > ayalew > >
Received on Thursday, 22 March 2001 06:55:08 UTC