RE: redefinition errors

> -----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.

Examples of cases where elements of the same name can have different type
would be useful.  Particularly anything related to what I'm trying to
achieve which is to define a standard form of property such as

 <element name='property'>
  <attribute name='name' type='CDATA'/>
  <attribute name='value' type='string'/>
 </element>

...for use within an entity elements which can contain zero or more
properties. Different element types will be defined to represent different
kinds of entity (person, document etc.). Some of the entity element types
will have mandatory properties. All will allow arbitrary additional
properties.

You may remember me trying to do this a while back using a fixed name
attribute to mandate that <property name='displayName' value=''/> was
present, but couldn't then allow additional properties "because attributes
are not part of the content model".

I'm still not sure that this can't be done (although it seemed to have been
ruled out) and am beginning to feel I'm going round in circles because the
above is starting to sound like it may allow me to achieve what I need (or
something close enough to it to do the job).

I now wonder I can define a sequence with mandatory properties and have this
followed by another sequence containing an unrestricted number of
properties.

Something like
 <element name='person' xsi:type='entity'>

  <element name='mandatoryProperties'
   <sequence>
    <element name=property minOccurs='1'/>
     <attribute name='name' type='CDATA' use=fixed value='displayName'/>
     <attribute name='value' type='string/> 
    </element>
   </sequence>
  </element>

  <element name='miscellaneousProperties'
   <sequence>
    <element name=property minOccurs='0' maxOccurs='unbounded'>
     <attribute name='name' type='CDATA'/>
     <attribute name='value' type='string/> 
    </element>
   </sequence>     
  </element>

  </element>

Is this or something like it ok?

If not, any ideas for something that meets this requirement?

Thanks

Mark
--
Mark Hughes
  Agile HTML Editor
    http://www.agilic.com

Received on Wednesday, 10 January 2001 10:37:38 UTC