xsl-list
[Top] [All Lists]

Re: [xsl] XSD Question

2007-04-18 11:37:10
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


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--






--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>