Re: [xsl] XSD Question

Subject: Re: [xsl] XSD Question
From: Abel Braaksma <abel.online@xxxxxxxxx>
Date: Wed, 18 Apr 2007 20:34:50 +0200
Hunt, James A (GE, Corporate, consultant) wrote:
Hi Everyone!

Can you tell me how to make this field required using this XSD?

1. This is an XSLT list, I fail to see the connection.... 2. What does "this field" refer to?

Nevertheless, here's a rough guide:

a) Making an element required in XSD can be done by *not* setting the minOccurs attribute, or setting it to "1".
b) Making an attribute required in an XSD is done by setting it's "use" attribute to "required". The default is optional.


Cheers,
-- Abel
<?xml version=3D"1.0" encoding=3D"UTF-8" standalone=3D"yes"?> <xs:schema xmlns:xs=3D"http://www.w3.org/2001/XMLSchema";
elementFormDefault=3D"qualified">
<xs:element name=3D"assignedto">
<xs:simpleType>
<xs:restriction base=3D"xs:string"/>
</xs:simpleType>
</xs:element>
<xs:element name=3D"request">
<xs:complexType>
<xs:choice maxOccurs=3D"unbounded">
<xs:element ref=3D"assignedto"/>


			</xs:choice>
		</xs:complexType>
	</xs:element>
	<xs:element name=3D"requests">
		<xs:complexType>
			<xs:sequence>
				<xs:element ref=3D"request"
maxOccurs=3D"unbounded"/>
			</xs:sequence>=09
		</xs:complexType>
	</xs:element>
</xs:schema>

Thanks!
James

Current Thread