Hello Bob and Jeni,
Thanks a lot for you efforts. Very clear explanations.
Maybe using Schematron in combination with Schema is the solution. However if
possible I'd like to stick with Schema only. Schema would be very convenient
for writing automatically valid input files for a program. I guess adding
Schematron wouldn't be too bad if I could find an editor for writing XML
files that conform to Schema and Schematron. Right now I haven't even found
one that runs on linux for Schema alone yet. But that's just a matter of time
I guess.
Below is a partial attempt at writing a schema for my needs.
On Monday 17 June 2002 11:22, Jeni Tennison wrote:
> I don't think that it's possible to express this in XML Schema,
> because of the rule that the fields of identity constraints must only
> select one information item.
So you can't share keys between objects, for example require that all
<coutryside> and <city> objects have unique geographical locations?
That would foil another cunning plan I had that used the schema below to
define persons.
<xs:element name='person1'>
<xs:complexType>
<xs:sequence>
<xs:element ref='person2' minOccurs='0' maxOccurs='1'/>
</xs:sequence>
<xs:attribute name='name' type='xs:NCName'/>
</xs:complexType>
</xs:element>
<xs:element name='person2'>
<xs:complexType>
<xs:sequence>
<xs:element ref='person3' minOccurs='0' maxOccurs='1'/>
</xs:sequence>
<xs:attribute name='acquaintance-person1' type='xs:nonNegativeInteger'
default='0'/>
<xs:attribute name='name' type='xs:NCName'/>
</xs:complexType>
</xs:element>
<xs:element name='person3'>
<xs:complexType>
<xs:attribute name='acquaintance-person1' type='xs:nonNegativeInteger'
default='0'/>
<xs:attribute name='acquaintance-person2' type='xs:nonNegativeInteger'
default='0'/>
<xs:attribute name='name' type='xs:NCName'/>
</xs:complexType>
</xs:element>
This will of course only work for a limited number of people. Is it possible
to refer to all persons with a single key?
Best regards, Jos