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

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. An Object is described by properties (i.e., an Object element is complex, with property child elements). The value of a property is either a simple value or an Object.  For example, the value of this property element is a simple value:

<title>The Implementation of Functional Programming Languages</title>

The value of this property element is an Object:

    <author>
        <Person>
            <name>Simon L. Peyton Jones</name>
        </Person>
    </author>

Person is an Object.

So, how do I create a property type such that elements derived from it can have a value that is either simple or an Object?

/Roger

Received on Thursday, 3 November 2011 17:15:58 UTC