Re: How to define a complexType so that derived types can have simple content or complex content?

On 03/11/2011 17:15, Costello, Roger L. wrote:
> Michael Kay wrote:
>
>> Why do you want to use the same type to describe two things that appear
>> on the surface to have quite unrelated structure? What are you hoping to
>> achieve, that you could not achieve by using two completely different
>> and unrelated types?
> I want to categorize all elements as either an Object or a property.

I think that's a semantic categorization concerning the meaning or usage 
of the element. As such it has nothing to do with the concept of 'type' 
as defined in XSD, which is a categorization according to constraints on 
the content of the element. This is in line with the conventional use of 
the term in programming languages. I think it's probably a mistake to 
try and use the concept of 'type' to represent an ontological 
distinction of this nature.

If elements in an XML model correspond to concepts such as objects or 
properties in a UML structural model, then I would think it is 
appropriate to capture this provenance using custom annotations in the 
XSD schema.

Michael Kay
Saxonica

Received on Thursday, 3 November 2011 23:53:11 UTC