RE: <group> legal under <extension>?

Hamish-

I dug through this issue earlier this week. I needed to define a
complexType to have [1] a fixed enumeration of valid children, [2] their
was no specific sequence or cardinality for the children, [3] only one
of the valid children of any of the appropriate types is required. Spy
was happy with the following code (though I haven't put it into
integration testing yet):

	<xs:complexType name="form">
		<xs:complexContent>
			<xs:extension base="container">
				<xs:group ref="formContent"
minOccurs="1" maxOccurs="unbounded"/>
				<xs:attribute name="formName"
type="xs:string"/>
				<xs:attribute name="uiParentContainerID"
type="xs:int"/>
				<xs:attribute name="workflow"
type="xs:string"/>
			</xs:extension>
		</xs:complexContent>
	</xs:complexType>
	<xs:group name="formContent">
		<xs:choice maxOccurs="unbounded">
			<xs:element name="fieldGroup" type="container"/>
			<xs:element name="group" type="container"/>
			<xs:element name="hidden" type="container"/>
			<xs:element name="iFrame" type="container"/>
			<xs:element name="outlookBar" type="container"/>
			<xs:element name="processingRules"
type="container"/>
			<xs:element name="renderWrapper"
type="container"/>
			<xs:element name="tabSet" type="container"/>
			<xs:element name="table" type="container"/>
		</xs:choice>
	</xs:group>

-----Original Message-----
From: Hamish Eisler [mailto:HEisler@2roam.com] 
Sent: Thursday, October 11, 2001 8:34 PM
To: Xmlschema-Dev (E-mail)
Subject: <group> legal under <extension>?

Hi everyone -

Can someone in the know tell me if the following is legal?

	<xsd:complexType name="foo.extended.type">
		<xsd:complexContent>
			<xsd:extension base="xhtml:form.type">
				<xsd:group ref="foo.extension.content"/>
			</xsd:extension>
		</xsd:complexContent>	
	</xsd:complexType>	

Basically, can I use <group> to extend an element, instead of directly
placing a <sequence>, <choice>, or <all> node underneath?

Seems logical, but maybe I'm missing something (or XML Spy is)...

Thanks,

-Hamish

Received on Friday, 12 October 2001 11:29:29 UTC