schema.xsd 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. <?xml version="1.0"?>
  2. <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
  3. <xs:element name="recipe">
  4. <xs:complexType>
  5. <xs:sequence>
  6. <xs:element name="meta" type="MetaType" />
  7. <xs:element name="nutrition" type="NutritionType" />
  8. <xs:element name="ingredients" type="IngredientsType" />
  9. <xs:element name="steps" type="StepsType" />
  10. </xs:sequence>
  11. </xs:complexType>
  12. </xs:element>
  13. <xs:complexType name="StepsType">
  14. <xs:sequence>
  15. <xs:element name="step" type="StepType" minOccurs="1" maxOccurs="unbounded" />
  16. </xs:sequence>
  17. </xs:complexType>
  18. <xs:complexType name="MetaType">
  19. <xs:sequence>
  20. <xs:element name="categories" type="CategoriesType" minOccurs="0" maxOccurs="1" />
  21. <xs:element name="title" type="xs:string" />
  22. <xs:element name="author" type="xs:string" />
  23. <xs:element name="date" minOccurs="0" maxOccurs="1" type="xs:date" />
  24. <xs:element name="collections" minOccurs="0" maxOccurs="1" type="CollectionsType" />
  25. </xs:sequence>
  26. </xs:complexType>
  27. <xs:complexType name="NutritionType">
  28. <xs:sequence>
  29. <xs:element name="servings" type="xs:positiveInteger" />
  30. <xs:element name="servingSize" type="xs:string" />
  31. <xs:element name="caloriesPerServing" type="xs:positiveInteger" />
  32. <xs:element name="fat" type="xs:positiveInteger" />
  33. <xs:element name="cholesterol" type="xs:positiveInteger" />
  34. <xs:element name="sodium" type="xs:positiveInteger" />
  35. <xs:element name="fiber" type="xs:positiveInteger" />
  36. <xs:element name="sugars" type="xs:positiveInteger" />
  37. <xs:element name="totalCarbs" type="xs:positiveInteger" />
  38. <xs:element name="protein" type="xs:positiveInteger" />
  39. </xs:sequence>
  40. </xs:complexType>
  41. <xs:complexType name="CollectionsType">
  42. <xs:sequence>
  43. <xs:element name="collection" minOccurs="0" maxOccurs="unbounded" type="xs:string" />
  44. </xs:sequence>
  45. </xs:complexType>
  46. <xs:complexType name="CategoriesType">
  47. <xs:sequence>
  48. <xs:element name="category" minOccurs="0" maxOccurs="unbounded" type="xs:string" />
  49. </xs:sequence>
  50. </xs:complexType>
  51. <xs:complexType name="IngredientCategoryType">
  52. <xs:simpleContent>
  53. <xs:extension base="xs:string">
  54. <xs:attribute name="ref" type="xs:string" />
  55. </xs:extension>
  56. </xs:simpleContent>
  57. </xs:complexType>
  58. <xs:complexType name="IngredientCategoriesType">
  59. <xs:sequence>
  60. <xs:element name="category" minOccurs="0" maxOccurs="unbounded" type="IngredientCategoryType" />
  61. </xs:sequence>
  62. </xs:complexType>
  63. <xs:complexType name="IngredientsType">
  64. <xs:sequence>
  65. <xs:element name="categories" type="IngredientCategoriesType" />
  66. <xs:element name="ingredient" type="IngredientType" minOccurs="1" maxOccurs="unbounded" />
  67. </xs:sequence>
  68. </xs:complexType>
  69. <xs:complexType name="IngredientType">
  70. <xs:attribute name="ref" type="xs:string" />
  71. <xs:attribute name="ingredient" type="xs:string" />
  72. <xs:attribute name="amount" type="xs:positiveInteger" />
  73. <xs:attribute name="unit" type="xs:string" />
  74. <xs:attribute name="categories" type="xs:string" />
  75. </xs:complexType>
  76. <xs:complexType name="StepType" mixed="true">
  77. <xs:sequence>
  78. <xs:element name="ingredient" minOccurs="0" maxOccurs="unbounded">
  79. <xs:complexType>
  80. <xs:attribute name="ref" type="xs:string" />
  81. <xs:attribute name="category" type="xs:string" />
  82. </xs:complexType>
  83. </xs:element>
  84. </xs:sequence>
  85. <xs:attribute name="ref" type="xs:string" />
  86. <xs:attribute name="sequence" type="xs:positiveInteger" />
  87. </xs:complexType>
  88. </xs:schema>