Share Pastebin
Guest
Public paste!

Untitled

By: a guest | Mar 20th, 2010 | Syntax: XML | Size: 18.08 KB | Hits: 72 | Expires: Never
Copy text to clipboard
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
  3.  
  4.   <!-- define a faculty_members element -->
  5.   <xs:element name="faculty_members" type="faculty_members_type"/>
  6.  
  7.   <!-- faculty_members_type -->
  8.   <xs:complexType name="faculty_members_type">
  9.     <xs:sequence>
  10.       <xs:element name="faculty_member" type="faculty_member_type" minOccurs="0" maxOccurs="unbounded"/>
  11.     </xs:sequence>
  12.   </xs:complexType>
  13.  
  14.   <!-- faculty_member_type -->
  15.   <xs:complexType name="faculty_member_type">
  16.     <xs:all>
  17.       <xs:element name="name" type="name_type"/>
  18.       <xs:element name="username" type="username_type"/>
  19.       <xs:element name="faculty_type" type="faculty_type_type"/>
  20.       <xs:element name="office" type="location_type"/>
  21.       <xs:element name="email_addresses" type="email_addresses_type"/>
  22.       <xs:element name="websites" type="websites_type" minOccurs="0"/>
  23.       <xs:element name="phone_numbers" type="phone_numbers_type" minOccurs="0"/>
  24.       <xs:element name="research_areas" type="research_areas_type" minOccurs="0"/>
  25.       <xs:element name="degrees" type="degrees_type" minOccurs="0"/>
  26.       <xs:element name="awards" type="awards_type" minOccurs="0"/>
  27.       <xs:element name="grants" type="grants_type" minOccurs="0"/>
  28.       <xs:element name="patents" type="patents_type" minOccurs="0"/>
  29.       <xs:element name="previous_positions" type="previous_positions_type" minOccurs="0"/>
  30.       <xs:element name="office_hours" type="meeting_times_and_places_type" minOccurs="0"/>
  31.       <xs:element name="classes" type="classes_type" minOccurs="0"/>
  32.       <xs:element name="published_books" type="published_books_type" minOccurs="0"/>
  33.       <xs:element name="journal_articles" type="journal_articles_type" minOccurs="0"/>
  34.       <xs:element name="conferences" type="conferences_type" minOccurs="0"/>
  35.       <xs:element name="grad_students" type="grad_students_type" minOccurs="0"/>
  36.     </xs:all>
  37.   </xs:complexType>
  38.  
  39.   <!-- first_name_type -->
  40.   <xs:simpleType name="first_name_type">
  41.     <xs:restriction base="xs:normalizedString">
  42.       <xs:pattern value="[\w'-]+"/>
  43.     </xs:restriction>
  44.   </xs:simpleType>
  45.  
  46.   <!-- last_name_type -->
  47.   <xs:simpleType name="last_name_type">
  48.     <xs:restriction base="xs:normalizedString">
  49.       <xs:pattern value="[\w'-]+"/>
  50.     </xs:restriction>
  51.   </xs:simpleType>
  52.  
  53.   <!-- middle_name_type -->
  54.   <xs:simpleType name="middle_name_type">
  55.     <xs:restriction base="xs:normalizedString">
  56.       <xs:pattern value="[\w'-]+"/>
  57.     </xs:restriction>
  58.   </xs:simpleType>
  59.  
  60.   <!-- name_type -->
  61.   <xs:complexType name="name_type">
  62.     <xs:all>
  63.       <xs:element name="first_name" type="first_name_type"/>
  64.       <xs:element name="middle_name" type="middle_name_type" minOccurs="0"/>
  65.       <xs:element name="last_name" type="last_name_type"/>
  66.     </xs:all>
  67.   </xs:complexType>
  68.  
  69.   <!-- username_type -->
  70.   <xs:simpleType name="username_type">
  71.     <xs:restriction base="xs:normalizedString">
  72.       <xs:pattern value="[a-z_][a-z0-9_-]*"/>
  73.     </xs:restriction>
  74.   </xs:simpleType>
  75.  
  76.   <!-- faculty_type_type -->
  77.   <xs:complexType name="faculty_type_type">
  78.     <xs:all>
  79.       <xs:element name="is_lecturer" type="xs:boolean"/>
  80.       <xs:element name="is_professor" type="xs:boolean"/>
  81.       <xs:element name="is_researcher" type="xs:boolean"/>
  82.     </xs:all>
  83.   </xs:complexType>
  84.  
  85.   <!-- building_abbreviation_type -->
  86.   <xs:simpleType name="building_abbreviation_type">
  87.     <xs:restriction base="xs:normalizedString">
  88.       <xs:pattern value="[A-Z]{2,5}" />
  89.     </xs:restriction>
  90.   </xs:simpleType>
  91.  
  92.   <!-- building_type -->
  93.   <xs:complexType name="building_type">
  94.     <xs:all>
  95.       <xs:element name="abbreviation" type="building_abbreviation_type"/>
  96.       <xs:element name="long_name" type="xs:normalizedString"/>
  97.     </xs:all>
  98.   </xs:complexType>
  99.  
  100.   <!-- room_type -->
  101.   <xs:simpleType name="room_type">
  102.     <xs:restriction base="xs:normalizedString">
  103.       <!-- TODO: we could add some restrictions here -->
  104.     </xs:restriction>
  105.   </xs:simpleType>
  106.  
  107.   <!-- location_type -->
  108.   <xs:complexType name="location_type">
  109.     <xs:all>
  110.       <xs:element name="building" type="building_type" />
  111.       <xs:element name="room" type="room_type" />
  112.     </xs:all>
  113.   </xs:complexType>
  114.  
  115.   <!-- email_type -->
  116.   <xs:simpleType name="email_type">
  117.     <xs:restriction base="xs:normalizedString">
  118.       <!-- pattern is taken and modified from the example at http://www.regular-expressions.info/email.html -->
  119.       <xs:pattern value="[a-z0-9!#$%&amp;'*+/=?^_`{|}~-]+(\.[a-z0-9!#$%&amp;'*+/=?^_`{|}~-]+)*@([a-z0-9]([a-z0-9-]*[a-z0-9])?\.)+([A-Z]{2}|edu|com|org|net|gov|mil|biz|info|mobi|name|aero|jobs|museum)"/>
  120.     </xs:restriction>
  121.   </xs:simpleType>
  122.  
  123.   <!-- email_addresses_type -->
  124.   <xs:complexType name="email_addresses_type">
  125.     <xs:sequence>
  126.       <xs:element name="email" type="email_type" minOccurs="1" maxOccurs="unbounded"/>
  127.     </xs:sequence>
  128.   </xs:complexType>
  129.  
  130.   <!-- website_type -->
  131.   <!--  NOTE: this might be too restrictive. Are there any other ways to specify a webpage?  -->
  132.   <xs:simpleType name="website_type">
  133.     <xs:restriction base="xs:anyURI">
  134.       <xs:pattern value="http://.*|https://.*|shttp://.*"/>
  135.     </xs:restriction>
  136.   </xs:simpleType>
  137.  
  138.   <!-- websites_type -->
  139.   <xs:complexType name="websites_type">
  140.     <xs:sequence>
  141.       <xs:element name="website" type="website_type" minOccurs="0" maxOccurs="unbounded"/>
  142.     </xs:sequence>
  143.   </xs:complexType>
  144.  
  145.   <!-- country_code_type -->
  146.   <xs:simpleType name="country_code_type">
  147.     <xs:restriction base="xs:normalizedString">
  148.       <xs:pattern value="\d|\d\d|\d\d\d"/>
  149.     </xs:restriction>
  150.   </xs:simpleType>
  151.  
  152.   <!-- area_code_type -->
  153.   <xs:simpleType name="area_code_type">
  154.     <xs:restriction base="xs:normalizedString">
  155.       <xs:pattern value="\d\d\d"/>
  156.     </xs:restriction>
  157.   </xs:simpleType>
  158.  
  159.   <!-- number_type -->
  160.   <xs:simpleType name="number_type">
  161.     <xs:restriction base="xs:normalizedString">
  162.       <xs:pattern value="\d+"/>
  163.     </xs:restriction>
  164.   </xs:simpleType>
  165.  
  166.   <!-- phone_type_type -->
  167.   <xs:simpleType name="phone_type_type">
  168.     <xs:restriction base="xs:normalizedString">
  169.       <xs:enumeration value="home"/>
  170.       <xs:enumeration value="work"/>
  171.       <xs:enumeration value="cell"/>
  172.       <xs:enumeration value="fax"/>
  173.       <xs:enumeration value="pager"/>
  174.     </xs:restriction>
  175.   </xs:simpleType>
  176.  
  177.   <!-- phone_number_type -->
  178.   <xs:complexType name="phone_number_type">
  179.     <xs:all>
  180.       <xs:element name="phone_type" type="phone_type_type"/>
  181.       <xs:element name="country_code" type="country_code_type" minOccurs="0"/>
  182.       <xs:element name="area_code" type="area_code_type" minOccurs="0"/>
  183.       <xs:element name="number" type="number_type"/>
  184.     </xs:all>
  185.   </xs:complexType>
  186.  
  187.   <!-- phone_numbers_type -->
  188.   <xs:complexType name="phone_numbers_type">
  189.     <xs:sequence>
  190.       <xs:element name="phone_number" type="phone_number_type" minOccurs="0" maxOccurs="unbounded"/>
  191.     </xs:sequence>
  192.   </xs:complexType>
  193.  
  194.   <!-- research_area_type -->
  195.   <xs:simpleType name="research_area_type">
  196.     <xs:restriction base="xs:normalizedString">
  197.     </xs:restriction>
  198.   </xs:simpleType>
  199.  
  200.   <!-- research_areas_type -->
  201.   <xs:complexType name="research_areas_type">
  202.     <xs:sequence>
  203.       <xs:element name="research_area" type="research_area_type" minOccurs="0" maxOccurs="unbounded"/>
  204.     </xs:sequence>
  205.   </xs:complexType>
  206.  
  207.   <!-- degree_type_type -->
  208.   <xs:simpleType name="degree_type_type">
  209.     <xs:restriction base="xs:normalizedString">
  210.       <xs:enumeration value="Certificate of Completion"/>
  211.       <xs:enumeration value="Associate's Degree"/>
  212.       <xs:enumeration value="Bachelor's Degree"/>
  213.       <xs:enumeration value="Master's Degree"/>
  214.       <xs:enumeration value="Doctoral Degree"/>
  215.       <xs:enumeration value="Honorary Degree"/>
  216.     </xs:restriction>
  217.   </xs:simpleType>
  218.  
  219.   <!-- degree_type -->
  220.   <xs:complexType name="degree_type">
  221.     <xs:all>
  222.       <xs:element name="date_awarded" type="xs:date" />
  223.       <xs:element name="institution" type="xs:normalizedString" />
  224.       <xs:element name="degree_type" type="degree_type_type" />
  225.       <xs:element name="specialization" type="xs:normalizedString"/>
  226.     </xs:all>
  227.   </xs:complexType>
  228.  
  229.   <!-- degrees_type -->
  230.   <xs:complexType name="degrees_type">
  231.     <xs:sequence>
  232.       <xs:element name="degree" type="degree_type" minOccurs="0" maxOccurs="unbounded"/>
  233.     </xs:sequence>
  234.   </xs:complexType>
  235.  
  236.   <!-- award_type -->
  237.   <xs:complexType name="award_type">
  238.     <xs:all>
  239.       <xs:element name="name" type="xs:normalizedString" />
  240.       <xs:element name="date_awarded" type="xs:date" />
  241.     </xs:all>
  242.   </xs:complexType>
  243.  
  244.   <!-- awards_type -->
  245.   <xs:complexType name="awards_type">
  246.     <xs:sequence>
  247.       <xs:element name="award" type="award_type" minOccurs="0" maxOccurs="unbounded"/>
  248.     </xs:sequence>
  249.   </xs:complexType>
  250.  
  251.   <!-- dollar_type -->
  252.   <xs:simpleType name="dollar_type">
  253.     <xs:restriction base="xs:normalizedString">
  254.       <xs:pattern value="([123456789]\d*(\.\d\d)?)|(\.\d\d)"/>
  255.     </xs:restriction>
  256.   </xs:simpleType>
  257.  
  258.   <!-- grant_type -->
  259.   <xs:complexType name="grant_type">
  260.     <xs:all>
  261.       <xs:element name="name" type="xs:normalizedString" />
  262.       <xs:element name="amount" type="dollar_type" />
  263.       <xs:element name="date_awarded" type="xs:date" />
  264.       <xs:element name="awarded_by" type="xs:normalizedString" />
  265.     </xs:all>
  266.   </xs:complexType>
  267.  
  268.   <!-- grants_type -->
  269.   <xs:complexType name="grants_type">
  270.     <xs:sequence>
  271.       <xs:element name="grant" type="grant_type" minOccurs="0" maxOccurs="unbounded"/>
  272.     </xs:sequence>
  273.   </xs:complexType>
  274.  
  275.   <!-- patent_id_type -->
  276.   <!-- NOTE: this uses "continuous numbering format"(the format used by the US) as specified at:
  277.   http://www.cas.org/training/stneasytips/patentnumber2.html#anchor1 -->
  278.   <xs:simpleType name="patent_id_type">
  279.     <xs:restriction base="xs:normalizedString">
  280.       <xs:pattern value="\c\c\d\d\d\d\d\d\d\d"/>
  281.     </xs:restriction>
  282.   </xs:simpleType>
  283.  
  284.   <!-- patent_type -->
  285.   <xs:complexType name="patent_type">
  286.     <xs:all>
  287.       <xs:element name="patent_title" type="xs:normalizedString" />
  288.       <xs:element name="date_awarded" type="xs:date" />
  289.       <xs:element name="patent_id" type="patent_id_type" />
  290.     </xs:all>
  291.   </xs:complexType>
  292.  
  293.   <!-- patents_type -->
  294.   <xs:complexType name="patents_type">
  295.     <xs:sequence>
  296.       <xs:element name="patent" type="patent_type" minOccurs="0" maxOccurs="unbounded"/>
  297.     </xs:sequence>
  298.   </xs:complexType>
  299.  
  300.   <!-- previous_position_type -->
  301.   <xs:complexType name="previous_position_type">
  302.     <xs:all>
  303.       <xs:element name="location" type="xs:normalizedString" />
  304.       <xs:element name="start_date" type="xs:date" />
  305.       <xs:element name="end_date" type="xs:date" />
  306.       <xs:element name="position" type="xs:normalizedString" />
  307.     </xs:all>
  308.   </xs:complexType>
  309.  
  310.   <!-- previous_positions_type -->
  311.   <xs:complexType name="previous_positions_type">
  312.     <xs:sequence>
  313.       <xs:element name="previous_position" type="previous_position_type" minOccurs="0" maxOccurs="unbounded"/>
  314.     </xs:sequence>
  315.   </xs:complexType>
  316.  
  317.   <!-- day_type -->
  318.   <xs:simpleType name="day_type">
  319.     <xs:restriction base="xs:normalizedString">
  320.       <xs:enumeration value="Monday"/>
  321.       <xs:enumeration value="Tuesday"/>
  322.       <xs:enumeration value="Wednesday"/>
  323.       <xs:enumeration value="Thursday"/>
  324.       <xs:enumeration value="Friday"/>
  325.     </xs:restriction>
  326.   </xs:simpleType>
  327.    
  328.   <!-- days_type -->
  329.   <xs:complexType name="days_type">
  330.     <xs:sequence>
  331.       <!-- TODO: it would be nice to find a way to make it so that each day is different -->
  332.       <xs:element name="day" type="day_type" maxOccurs="5"/>
  333.     </xs:sequence>
  334.   </xs:complexType>
  335.  
  336.   <!-- meeting_time_and_place_type -->
  337.   <xs:complexType name="meeting_time_and_place_type">
  338.     <xs:all>
  339.       <xs:element name="start_time" type="xs:time" />
  340.       <xs:element name="end_time" type="xs:time" />
  341.       <xs:element name="location" type="location_type" />
  342.       <xs:element name="days" type="days_type" />
  343.     </xs:all>
  344.   </xs:complexType>
  345.  
  346.   <!-- meeting_times_and_places_type -->
  347.   <xs:complexType name="meeting_times_and_places_type">
  348.     <xs:sequence>
  349.       <xs:element name="meeting_time_and_place" type="meeting_time_and_place_type" minOccurs="0" maxOccurs="unbounded"/>
  350.     </xs:sequence>
  351.   </xs:complexType>
  352.  
  353.   <!-- names_type -->
  354.   <xs:complexType name="names_type">
  355.     <xs:sequence>
  356.       <xs:element name="name" type="name_type" minOccurs="0" maxOccurs="unbounded"/>
  357.     </xs:sequence>
  358.   </xs:complexType>
  359.  
  360.   <!-- year_type -->
  361.   <xs:simpleType name="year_type">
  362.     <xs:restriction base="xs:normalizedString">
  363.       <xs:pattern value="\d\d\d\d"/>
  364.     </xs:restriction>
  365.   </xs:simpleType>
  366.  
  367.   <!-- unique_number_type -->
  368.   <xs:simpleType name="unique_number_type">
  369.     <xs:restriction base="xs:normalizedString">
  370.       <xs:pattern value="\d\d\d\d\d"/>
  371.     </xs:restriction>
  372.   </xs:simpleType>
  373.  
  374.   <!-- semester_type -->
  375.   <xs:simpleType name="semester_type">
  376.     <xs:restriction base="xs:normalizedString">
  377.       <xs:enumeration value="fall"/>
  378.       <xs:enumeration value="spring"/>
  379.       <xs:enumeration value="summer first term"/>
  380.       <xs:enumeration value="summer second term"/>
  381.       <xs:enumeration value="summer whole term"/>
  382.       <xs:enumeration value="summer nine week term"/>
  383.     </xs:restriction>
  384.   </xs:simpleType>
  385.    
  386.   <!-- field_of_study_type -->
  387.   <xs:simpleType name="field_of_study_type">
  388.     <xs:restriction base="xs:normalizedString">
  389.       <xs:pattern value="[A-Z]{1,3}"/>
  390.     </xs:restriction>
  391.   </xs:simpleType>
  392.  
  393.   <!-- course_three_digit_number_type -->
  394.   <xs:simpleType name="course_three_digit_number_type">
  395.     <xs:restriction base="xs:normalizedString">
  396.       <xs:pattern value="\d\d\d"/>
  397.     </xs:restriction>
  398.   </xs:simpleType>
  399.  
  400.   <!-- course_number_type -->
  401.   <xs:complexType name="course_number_type">
  402.     <xs:all>
  403.       <xs:element name="field_of_study" type="field_of_study_type" />
  404.       <xs:element name="number" type="course_three_digit_number_type"/>
  405.     </xs:all>
  406.   </xs:complexType>
  407.  
  408.   <!-- class_type -->
  409.   <xs:complexType name="class_type">
  410.     <xs:all>
  411.       <xs:element name="unique_number" type="unique_number_type" />
  412.       <xs:element name="name" type="xs:normalizedString" />
  413.       <xs:element name="description" type="xs:normalizedString" />
  414.       <xs:element name="course_number" type="course_number_type" />
  415.       <xs:element name="semester" type="semester_type" />
  416.       <xs:element name="year" type="year_type" />
  417.       <xs:element name="teaching_assistants" type="names_type" />
  418.       <xs:element name="meeting_times_and_places" type="meeting_times_and_places_type"/>
  419.     </xs:all>
  420.   </xs:complexType>
  421.  
  422.   <!-- classes_type -->
  423.   <xs:complexType name="classes_type">
  424.     <xs:sequence>
  425.       <xs:element name="class" type="class_type" minOccurs="0" maxOccurs="unbounded"/>
  426.     </xs:sequence>
  427.   </xs:complexType>
  428.  
  429.   <!-- ISBN_type -->
  430.   <xs:simpleType name="ISBN_type">
  431.     <xs:restriction base="xs:normalizedString">
  432.       <!-- NOTE: ISBN numbers can be either 10 or 13 digit versions,
  433.      and both versions can have "X" or a numeric digit as the last 'digit' -->
  434.       <xs:pattern value="(\d\d\d)?\d\d\d\d\d\d\d\d\d[X0123456789]"/>
  435.     </xs:restriction>
  436.   </xs:simpleType>
  437.  
  438.   <!-- book_type -->
  439.   <xs:complexType name="book_type">
  440.     <xs:all>
  441.       <xs:element name="ISBN" type="ISBN_type" />
  442.       <xs:element name="title" type="xs:normalizedString" />
  443.       <xs:element name="publisher" type="xs:normalizedString" />
  444.       <xs:element name="date_published" type="xs:date" />
  445.       <xs:element name="other_authors" type="names_type" minOccurs="0"/>
  446.     </xs:all>
  447.   </xs:complexType>
  448.  
  449.   <!-- published_books_type -->
  450.   <xs:complexType name="published_books_type">
  451.     <xs:sequence>
  452.       <xs:element name="book" type="book_type" minOccurs="0" maxOccurs="unbounded"/>
  453.     </xs:sequence>
  454.   </xs:complexType>
  455.  
  456.   <!-- article_type -->
  457.   <xs:complexType name="article_type">
  458.     <xs:all>
  459.       <xs:element name="journal" type="xs:normalizedString" />
  460.       <xs:element name="title" type="xs:normalizedString" />
  461.       <xs:element name="issue_date" type="xs:date" />
  462.       <xs:element name="other_authors" type="names_type" />
  463.     </xs:all>
  464.   </xs:complexType>
  465.  
  466.   <!-- journal_articles_type -->
  467.   <xs:complexType name="journal_articles_type">
  468.     <xs:sequence>
  469.       <xs:element name="article" type="article_type" minOccurs="0" maxOccurs="unbounded"/>
  470.     </xs:sequence>
  471.   </xs:complexType>
  472.  
  473.   <!-- conference_type -->
  474.   <xs:complexType name="conference_type">
  475.     <xs:all>
  476.       <xs:element name="date" type="xs:date" />
  477.       <xs:element name="name" type="xs:string" />
  478.       <xs:element name="location" type="xs:string" />
  479.       <xs:element name="presentation_title" type="xs:string" />
  480.     </xs:all>
  481.   </xs:complexType>
  482.  
  483.   <!-- conferences_type -->
  484.   <xs:complexType name="conferences_type">
  485.     <xs:sequence>
  486.       <xs:element name="conference" type="conference_type" minOccurs="0" maxOccurs="unbounded"/>
  487.     </xs:sequence>
  488.   </xs:complexType>
  489.  
  490.   <!-- grad_student_type -->
  491.   <xs:complexType name="grad_student_type">
  492.     <xs:all>
  493.       <xs:element name="name" type="name_type" />
  494.       <xs:element name="type" type="grad_degree_type" />
  495.       <xs:element name="writings" type="journal_articles_type" />
  496.       <xs:element name="date" type="xs:date" />
  497.     </xs:all>
  498.   </xs:complexType>
  499.  
  500.   <!-- conferences_type -->
  501.   <xs:complexType name="grad_students_type">
  502.     <xs:sequence>
  503.       <xs:element name="grad_student" type="grad_student_type" minOccurs="0" maxOccurs="unbounded"/>
  504.     </xs:sequence>
  505.   </xs:complexType>
  506.    
  507.   <!-- grad_degree_type -->
  508.   <xs:simpleType name="grad_degree_type">
  509.     <xs:restriction base="xs:normalizedString">
  510.       <xs:enumeration value="Master's Degree"/>
  511.       <xs:enumeration value="Doctoral Degree"/>
  512.     </xs:restriction>
  513.   </xs:simpleType>
  514. </xs:schema>