Hi Huichan: thank you for pushing for correct test cases for Prasenjit's generator. I am amazed how complicated XML schema is. If it would be well designed, it should be easy to express expressions elegantly. Your analysis seems right that extension is not the right way to express alternation. Extension seems to allow to extend a type but it does not give us alternation. In http://www.w3.org/TR/2000/CR-xmlschema-2-20001024/ I read: [Definition:] Union datatypes are those whose value spaces and lexical spaces are the union of the value spaces and lexical spaces of two or more other datatypes. This sounds more like alternation. I look forward to your schema that defines E as a union of S and C. This is high priority work because without solid examples, Prasenjit cannot write the generator. -- Karl From hche@coe.neu.edu Wed Feb 28 12:46:30 2001 Date: Wed, 28 Feb 2001 12:44:15 -0500 (EST) From: Huichan He To: Karl Lieberherr cc: adakp@ccs.neu.edu, jing@ccs.neu.edu, zhzhu@MIT.EDU Subject: Re: XML doc checking and MI Hi professor, The schema I wrote yesterday was actually according to this CD: Exp = C. C = Op List(S). S = [Exp] [ int]. Op = string. So, C can contain Op, value, or other C. I wrote another xml schema according to the CD you gave me. I found that the alternation in CD can not be directly translated to extension relationship in schema. For example, E : S | C. can not be expressed as: ... ... The reason is, in CD the part of S and C are also part of E, whileas in schema, the child element of S and C can not be taken as the child of E. This is confirmed by XML spy. So, I think a solution could be switching the roles in the extension relationship: ... and at the same time, let E contain a child element of type S. This way will guarantee that the child of S and C will also be child of E. The schema for the cd you gave me is attached below: This schema allows the XML doc you sent me before about (+ 3 5). I think we might also do this with union type in xml schema. I'll let you know the detail after i figure it out. Huichan --------------------------- Huichan He Teaching Assistant 334 Snell Engineering Center Northeastern Univ Email: hche@coe.neu.edu Tel: (617)373-5340 On -1 xxx -1, Huichan He wrote: > Hi professor, > > I expressed (+ 3 (* 6 7 8 )) by the following schema and document. I > didn't use abstract type here, cause I don't think it's necessary for this > problem. They were validated by XML spy. > > -------------XML Schema------------------------ > ----------------------------------------------- > > > > > > > minOccurs="0"/> > > > > > > > > minOccurs="0" /> > > > > > > > > > minOccurs="0" maxOccurs="unbounded"/> > > > > > > > -----------------XML Document------------- > ------------------------------------------ > > xsi:noNamespaceSchemaLocation="D:\huichan\thesis-soft\schema test > cases\pras-3.xsd"> > > "+" > > > "*" > > 6 > > > 7 > > > 8 > > > > > 3 > > > > > > Huichan He > Teaching Assistant > 334 Snell Engineering Center > Northeastern Univ > > Email: hche@coe.neu.edu > Tel: (617)373-5340 > > >