Skip to content

Instantly share code, notes, and snippets.

@srishilesh
Created November 4, 2020 16:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save srishilesh/3dc43a0c08430d75e77969086bcd5ee8 to your computer and use it in GitHub Desktop.
Save srishilesh/3dc43a0c08430d75e77969086bcd5ee8 to your computer and use it in GitHub Desktop.
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" />
<xs:element name="root" type="rootType" />
<xs:complexType name="rootType">
<xs:sequence minOccurs="0" maxOccurs="unbounded">
<xs:element name="event" type="eventType" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="eventType">
<xs:sequence maxOccurs="1">
<xs:element name="event_id" type="IDType" />
<xs:element name="event_name" type="stringType" />
<xs:element name="event_desc" type="stringType" />
<xs:element name="event_tags" type="tagsType" />
<xs:element name="event_type_participation" type="participationType" />
<xs:element name="event_timing" type="timingType" />
<xs:element name="event_organizer_email" type="emailType" />
<xs:element name="event_organizer_phone" type="phoneType" />
</xs:sequence>
</xs:complexType>
<xs:simpleType name="IDType">
<xs:restriction base="xs:integer">
<xs:minInclusive value="0"></xs:minInclusive>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="stringType">
<xs:restriction base="xs:string" />
</xs:simpleType>
<xs:complexType name="tagsType">
<xs:sequence maxOccurs="5">
<xs:element name="tag" />
</xs:sequence>
</xs:complexType>
<xs:attribute name="id" >
<xs:simpleType >
<xs:restriction base="xs:string">
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:simpleType name="participationType">
<xs:restriction base="xs:string">
<xs:enumeration value="Solo"></xs:enumeration>
<xs:enumeration value="Team"></xs:enumeration>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="timeType">
<xs:restriction base="xs:dateTime" />
</xs:simpleType>
<xs:simpleType name="emailType">
<xs:restriction base="xs:string">
<xs:pattern value="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"></xs:pattern>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="phoneType">
<xs:restriction base="xs:string">
<xs:pattern value="\+?\d[\d -]{8,12}\d"></xs:pattern>
</xs:restriction>
</xs:simpleType>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment