- From: Henry S. Thompson <ht@cogsci.ed.ac.uk>
- Date: 11 Jan 2001 13:53:21 +0000
- To: MarkH@i2.co.uk
- Cc: xmlschema-dev@w3.org
MarkH@i2.co.uk writes: > > -----Original Message----- > > From: ht@cogsci.ed.ac.uk [mailto:ht@cogsci.ed.ac.uk] > > Sent: 10 January 2001 15:05 > > > MarkH@i2.co.uk writes: > > > > > So just to confirm that I've got it now... am I right to > > conclude that once > > > we've reached a <sequence> I'm stuffed? That is, once I've > > got something > > > like > > > > > > <items> > > > <sequence> > > > <elements> > > > ... > > > </sequence> > > > </items> > > > > > > Then there is nowhere within the children of that sequence > > that it will be > > > possible to have same name elements of different type? > > > > No, we're still on different pages -- the scope is determined in the > > _schema_, specifically in the complex type definition, not in the > > instance. The elements explicitly, indirectly or implicitly > > appearing > > in the content model are the potential conflict set, _not_ extending > > to element which may appear inside them as a result of > > _their_ content > > models. > > I don't understand this. At least I realise that this time :-) > > Can you illustrate the second sentence - particularly the chunk after the > final comma. Start with the illustration I've already supplied, with a few more details filled in: <xs:schema xmlns="http://www.example.com/bibl" targetNamespace="http://www.example.com/bibl"> <xs:complexType name="bibItem"> <xs:sequence> *1* <xs:element name="author" type="person"/> <xs:element name="title" type="xs:string"/> *2* ... </xs:sequence> </xs:complexType> ... <xs:complexType name="person"> <xs:sequence> *1* . . . <xs:element name="title" type="xs:NMTOKEN"/> *2* . . . </xs:sequence> </xs:complexType> </xs:schema> This is _still_ OK. Here's an instance: <bi xsi:type="bibItem"> <author><title>Mme</title> . . . <title>Ma Vie en Rose</title> . . . </bi> The two 'title' elements have different types, but because they come from different content models that's not a problem. Note this is not a lexical scope issue in the programming language sense -- it would still be OK if the schema looked like this: <xs:schema xmlns="http://www.example.com/bibl" targetNamespace="http://www.example.com/bibl"> <xs:complexType name="bibItem"> <xs:sequence> *1* <xs:element name="author"> <xs:complexType> <xs:sequence> *1* . . . <xs:element name="title" type="xs:NMTOKEN"/> *2* . . . </xs:sequence> </xs:complexType> </xs:element> <xs:element name="title" type="xs:string"/> *2* ... </xs:sequence> </xs:complexType> ... </xs:schema> There are two distinct content models here (the ones labelled *1*) so the two same-name-same-NS-different-type element decls at *2* are _not_ conflicting. But if it looked like this: <xs:schema xmlns="http://www.example.com/bibl" targetNamespace="http://www.example.com/bibl"> <xs:complexType name="bibItem"> <xs:sequence> *1* <xs:element name="..."/> <xs:choice> . . . <xs:element name="title" type="xs:NMTOKEN"/> *2* . . . </xs:choice> . . . <xs:element name="title" type="xs:string"/> *2* ... </xs:sequence> </xs:complexType> ... </xs:schema> this would be broken, because the two same-name-same-NS-different-type declarations at *2* are in the _same_ content model (there's only *1* left). Help? ht -- Henry S. Thompson, HCRC Language Technology Group, University of Edinburgh W3C Fellow 1999--2001, part-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/
Received on Thursday, 11 January 2001 08:53:24 UTC