extension element question

Hello again schemers,

I am going through the XFront schema tutorial[0] and have hit a spot that I
don't quite understand.

Why are the simpleContent and extension elements required here:

	<xsd:complexType name="linkType">
		<xsd:simpleContent>
			<xsd:extension base="xsd:string">
				<xsd:attribute name="title"
type="xsd:string" use="required"/>
				<xsd:attribute name="action"
type="xsd:string" use="required"/>
			</xsd:extension>
		</xsd:simpleContent>
	</xsd:complexType>

I'm not extending any types, at least not intentionally, so I'm not sure why
it's required. The element I'm trying to create should look like this:

	<link title="foo" action="bar"/>

There are no child elements or character data, the element will always be
empty except for the two required attributes.

Also, I don't quite understand exactly what the simpleContent element really
does. The MSXML docs state:

	"Contains extensions or restrictions on a complexType element with
character data or a simpleType element as content and contains no elements."

I don't fully understand exactly what that means. Since there is no CDATA
and it is not a simpleType, and definitely does not contain any child
elements, I see no reason for this element to be required.

However, if I eliminate either the extension or the entire simpleContent
wrapper, the validation fails and reports I did not declare a root element
(not shown in the above schema snippet)... :(

Thanks,
-dave

[0] http://www.xfront.com/#schema

Received on Friday, 25 October 2002 16:48:32 UTC