ui-layout-def.xsd 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
  3. targetNamespace="http://quadarax.com/ui-layout-definition"
  4. xmlns:tns="http://quadarax.com/ui-layout-definition"
  5. xmlns:patterns="http://quadarax.com/ui-layout-patterns"
  6. xmlns:views="http://quadarax.com/ui-layout-views"
  7. xmlns:validation="http://quadarax.com/ui-layout-validation"
  8. xmlns:basic="http://quadarax.com/ui-layout-basic-controls"
  9. xmlns:winforms="http://quadarax.com/ui-layout-winforms-controls"
  10. xmlns:avalonia="http://quadarax.com/ui-layout-avalonia-controls"
  11. xmlns:webawesome="http://quadarax.com/ui-layout-webawesome-controls"
  12. elementFormDefault="qualified"
  13. version="1.6">
  14. <!-- Import external schemas -->
  15. <xs:import namespace="http://quadarax.com/ui-layout-patterns" schemaLocation="ui-layout-patterns.xsd"/>
  16. <xs:import namespace="http://quadarax.com/ui-layout-views" schemaLocation="ui-layout-views.xsd"/>
  17. <xs:import namespace="http://quadarax.com/ui-layout-validation" schemaLocation="ui-layout-validation.xsd"/>
  18. <xs:import namespace="http://quadarax.com/ui-layout-basic-controls" schemaLocation="ui-layout-basic-controls.xsd"/>
  19. <xs:import namespace="http://quadarax.com/ui-layout-winforms-controls" schemaLocation="ui-layout-winforms-controls.xsd"/>
  20. <xs:import namespace="http://quadarax.com/ui-layout-avalonia-controls" schemaLocation="ui-layout-avalonia-controls.xsd"/>
  21. <xs:import namespace="http://quadarax.com/ui-layout-webawesome-controls" schemaLocation="ui-layout-webawesome-controls.xsd"/>
  22. <!-- Root element -->
  23. <xs:element name="ui-layout-def" type="tns:UILayoutDefType"/>
  24. <!-- Root element for window include files -->
  25. <xs:element name="windows" type="tns:WindowIncludeFileType"/>
  26. <!-- Platform Enumeration -->
  27. <xs:simpleType name="PlatformEnum">
  28. <xs:restriction base="xs:string">
  29. <xs:enumeration value="basic"/>
  30. <xs:enumeration value="winforms"/>
  31. <xs:enumeration value="avalonia"/>
  32. <xs:enumeration value="kde"/>
  33. <xs:enumeration value="web"/>
  34. <xs:enumeration value="mobile"/>
  35. <xs:enumeration value="mixed"/>
  36. </xs:restriction>
  37. </xs:simpleType>
  38. <!-- Accessibility Level Enumeration -->
  39. <xs:simpleType name="AccessibilityLevelEnum">
  40. <xs:restriction base="xs:string">
  41. <xs:enumeration value="basic"/>
  42. <xs:enumeration value="wcag-a"/>
  43. <xs:enumeration value="wcag-aa"/>
  44. <xs:enumeration value="wcag-aaa"/>
  45. <xs:enumeration value="section-508"/>
  46. <xs:enumeration value="ada"/>
  47. </xs:restriction>
  48. </xs:simpleType>
  49. <!-- Main document structure -->
  50. <xs:complexType name="UILayoutDefType">
  51. <xs:sequence>
  52. <xs:element name="validation-rules" type="tns:ValidationRulesType" minOccurs="0"/>
  53. <xs:element name="patterns" type="tns:PatternsType"/>
  54. <xs:element name="views" type="tns:ViewsType" minOccurs="0"/>
  55. <xs:element name="window-includes" type="tns:WindowIncludesType" minOccurs="0"/>
  56. <xs:element name="window" type="tns:WindowType" minOccurs="0" maxOccurs="unbounded"/>
  57. </xs:sequence>
  58. <xs:attribute name="version" type="xs:string" default="1.6"/>
  59. <xs:attribute name="schema-version" type="xs:string" fixed="1.6"/>
  60. <xs:attribute name="min-version" type="xs:string" default="1.0"/>
  61. <xs:attribute name="max-version" type="xs:string" default="2.0"/>
  62. <xs:attribute name="target-platform" type="tns:PlatformEnum" default="basic"/>
  63. <xs:attribute name="accessibility-compliance" type="tns:AccessibilityLevelEnum" default="basic"/>
  64. </xs:complexType>
  65. <!-- Window Include File Type -->
  66. <xs:complexType name="WindowIncludeFileType">
  67. <xs:sequence>
  68. <xs:element name="window" type="tns:WindowType" minOccurs="0" maxOccurs="unbounded"/>
  69. </xs:sequence>
  70. <xs:attribute name="schema-version" type="xs:string" default="1.6"/>
  71. <xs:attribute name="target-platform" type="tns:PlatformEnum" default="basic"/>
  72. </xs:complexType>
  73. <!-- Validation Rules Type -->
  74. <xs:complexType name="ValidationRulesType">
  75. <xs:sequence>
  76. <xs:element name="validation-include" type="tns:ValidationIncludeType" minOccurs="0" maxOccurs="unbounded"/>
  77. <xs:element name="rule" type="validation:ValidationRuleType" minOccurs="0" maxOccurs="unbounded"/>
  78. <xs:element name="custom-validator" type="validation:CustomValidatorType" minOccurs="0" maxOccurs="unbounded"/>
  79. <xs:element name="validation-profile" type="validation:ValidationProfileType" minOccurs="0" maxOccurs="unbounded"/>
  80. </xs:sequence>
  81. </xs:complexType>
  82. <!-- Validation Include Type -->
  83. <xs:complexType name="ValidationIncludeType">
  84. <xs:attribute name="src" type="xs:string" use="required"/>
  85. <xs:attribute name="important" type="xs:boolean" default="false"/>
  86. <xs:attribute name="min-version" type="xs:string"/>
  87. <xs:attribute name="max-version" type="xs:string"/>
  88. </xs:complexType>
  89. <!-- Patterns Type -->
  90. <xs:complexType name="PatternsType">
  91. <xs:sequence>
  92. <xs:element name="pattern-include" type="tns:PatternIncludeType" minOccurs="0" maxOccurs="unbounded"/>
  93. <xs:choice minOccurs="0" maxOccurs="unbounded">
  94. <xs:element name="control" type="patterns:ControlType"/>
  95. <xs:element name="structure" type="patterns:StructureType"/>
  96. <xs:element name="wireframe" type="patterns:WireframeType"/>
  97. </xs:choice>
  98. </xs:sequence>
  99. </xs:complexType>
  100. <!-- Pattern Include Type -->
  101. <xs:complexType name="PatternIncludeType">
  102. <xs:attribute name="src" type="xs:string" use="required"/>
  103. <xs:attribute name="important" type="xs:boolean" default="false"/>
  104. <xs:attribute name="platform" type="tns:PlatformEnum" default="basic"/>
  105. <xs:attribute name="min-version" type="xs:string"/>
  106. <xs:attribute name="max-version" type="xs:string"/>
  107. </xs:complexType>
  108. <!-- Views Type -->
  109. <xs:complexType name="ViewsType">
  110. <xs:sequence>
  111. <xs:element name="view-include" type="tns:ViewIncludeType" minOccurs="0" maxOccurs="unbounded"/>
  112. <xs:element name="view" type="views:ViewType" minOccurs="0" maxOccurs="unbounded"/>
  113. </xs:sequence>
  114. </xs:complexType>
  115. <!-- View Include Type -->
  116. <xs:complexType name="ViewIncludeType">
  117. <xs:attribute name="src" type="xs:string" use="required"/>
  118. <xs:attribute name="important" type="xs:boolean" default="false"/>
  119. <xs:attribute name="min-version" type="xs:string"/>
  120. <xs:attribute name="max-version" type="xs:string"/>
  121. </xs:complexType>
  122. <!-- Window Includes Type -->
  123. <xs:complexType name="WindowIncludesType">
  124. <xs:sequence>
  125. <xs:element name="window-include" type="tns:WindowIncludeType" minOccurs="0" maxOccurs="unbounded"/>
  126. </xs:sequence>
  127. </xs:complexType>
  128. <!-- Window Include Type -->
  129. <xs:complexType name="WindowIncludeType">
  130. <xs:attribute name="src" type="xs:string" use="required"/>
  131. <xs:attribute name="important" type="xs:boolean" default="false"/>
  132. <xs:attribute name="min-version" type="xs:string"/>
  133. <xs:attribute name="max-version" type="xs:string"/>
  134. </xs:complexType>
  135. <!-- FIXED: Window Template Type -->
  136. <xs:complexType name="WindowTemplateType" mixed="true">
  137. <xs:sequence>
  138. <!-- Allow any UI control elements from the current namespace -->
  139. <xs:any namespace="##targetNamespace" processContents="lax" minOccurs="0" maxOccurs="unbounded">
  140. <xs:annotation>
  141. <xs:documentation>
  142. Allows any UI control elements for window templates.
  143. Provides flexibility for any UI control without explicit definitions.
  144. </xs:documentation>
  145. </xs:annotation>
  146. </xs:any>
  147. </xs:sequence>
  148. </xs:complexType>
  149. <!-- FIXED: Window Control Instance Type -->
  150. <xs:complexType name="WindowControlInstanceType" mixed="true">
  151. <xs:sequence>
  152. <!-- Allow any UI control elements from the current namespace with recursive nesting -->
  153. <xs:any namespace="##targetNamespace" processContents="lax" minOccurs="0" maxOccurs="unbounded">
  154. <xs:annotation>
  155. <xs:documentation>
  156. Allows any UI control elements with full recursive nesting support.
  157. Enables complex UI hierarchies without explicit control definitions.
  158. </xs:documentation>
  159. </xs:annotation>
  160. </xs:any>
  161. </xs:sequence>
  162. <xs:anyAttribute processContents="lax"/>
  163. </xs:complexType>
  164. <!-- FIXED: Window Definition -->
  165. <xs:complexType name="WindowType">
  166. <xs:sequence>
  167. <xs:element name="attributes" type="tns:WindowAttributesType" minOccurs="0"/>
  168. <xs:element name="view-properties" type="tns:ViewPropertiesType" minOccurs="0"/>
  169. <xs:element name="data-binding" type="tns:DataBindingType" minOccurs="0"/>
  170. <xs:element name="accessibility" type="tns:AccessibilityType" minOccurs="0"/>
  171. <xs:choice>
  172. <xs:element name="template" type="tns:WindowTemplateType"/>
  173. <xs:element name="structure-ref" type="tns:StructureRefType"/>
  174. <xs:element name="slot-overrides" type="tns:SlotOverridesType"/>
  175. </xs:choice>
  176. </xs:sequence>
  177. <xs:attribute name="name" type="xs:string" use="required"/>
  178. <xs:attribute name="title" type="xs:string"/>
  179. <xs:attribute name="wireframe" type="xs:string"/>
  180. <xs:attribute name="view" type="xs:string"/>
  181. <xs:attribute name="target-platform" type="tns:PlatformEnum"/>
  182. <xs:attribute name="inherits" type="xs:string"/>
  183. <xs:attribute name="schema-version" type="xs:string" default="1.6"/>
  184. </xs:complexType>
  185. <!-- Window Attributes Type -->
  186. <xs:complexType name="WindowAttributesType">
  187. <xs:sequence>
  188. <xs:element name="attribute" type="tns:WindowAttributeType" maxOccurs="unbounded"/>
  189. </xs:sequence>
  190. </xs:complexType>
  191. <!-- Window Attribute Type -->
  192. <xs:complexType name="WindowAttributeType">
  193. <xs:attribute name="name" type="xs:string" use="required"/>
  194. <xs:attribute name="value" type="xs:string" use="required"/>
  195. <xs:attribute name="override" type="xs:boolean" default="false"/>
  196. </xs:complexType>
  197. <!-- View Properties Type -->
  198. <xs:complexType name="ViewPropertiesType">
  199. <xs:choice maxOccurs="unbounded">
  200. <xs:element name="property" type="tns:ViewPropertyType"/>
  201. <xs:element name="role" type="xs:string"/>
  202. <xs:element name="default" type="xs:boolean"/>
  203. </xs:choice>
  204. </xs:complexType>
  205. <!-- View Property Type -->
  206. <xs:complexType name="ViewPropertyType">
  207. <xs:attribute name="name" type="xs:string" use="required"/>
  208. <xs:attribute name="value" type="xs:string" use="required"/>
  209. <xs:attribute name="type" type="xs:string" default="string"/>
  210. </xs:complexType>
  211. <!-- Data Binding Type -->
  212. <xs:complexType name="DataBindingType">
  213. <xs:sequence>
  214. <xs:element name="binding" type="tns:BindingType" maxOccurs="unbounded"/>
  215. </xs:sequence>
  216. </xs:complexType>
  217. <!-- Binding Type -->
  218. <xs:complexType name="BindingType">
  219. <xs:attribute name="source" type="xs:string" use="required"/>
  220. <xs:attribute name="target" type="xs:string" use="required"/>
  221. <xs:attribute name="mode" type="tns:BindingModeEnum" default="OneWay"/>
  222. <xs:attribute name="converter" type="xs:string"/>
  223. </xs:complexType>
  224. <!-- Binding Mode Enumeration -->
  225. <xs:simpleType name="BindingModeEnum">
  226. <xs:restriction base="xs:string">
  227. <xs:enumeration value="OneWay"/>
  228. <xs:enumeration value="TwoWay"/>
  229. <xs:enumeration value="OneTime"/>
  230. <xs:enumeration value="OneWayToSource"/>
  231. </xs:restriction>
  232. </xs:simpleType>
  233. <!-- Accessibility Type -->
  234. <xs:complexType name="AccessibilityType">
  235. <xs:sequence>
  236. <xs:element name="requirement" type="tns:AccessibilityRequirementType" maxOccurs="unbounded"/>
  237. </xs:sequence>
  238. <xs:attribute name="compliance-level" type="tns:AccessibilityLevelEnum" default="basic"/>
  239. </xs:complexType>
  240. <!-- Accessibility Requirement Type -->
  241. <xs:complexType name="AccessibilityRequirementType">
  242. <xs:attribute name="standard" type="xs:string" use="required"/>
  243. <xs:attribute name="level" type="xs:string" use="required"/>
  244. <xs:attribute name="description" type="xs:string"/>
  245. <xs:attribute name="required" type="xs:boolean" default="true"/>
  246. </xs:complexType>
  247. <!-- Structure Reference Type -->
  248. <xs:complexType name="StructureRefType">
  249. <xs:attribute name="name" type="xs:string" use="required"/>
  250. <xs:attribute name="override-attributes" type="xs:string"/>
  251. </xs:complexType>
  252. <!-- Slot Overrides Type -->
  253. <xs:complexType name="SlotOverridesType">
  254. <xs:sequence>
  255. <xs:element name="slot" type="tns:SlotType" maxOccurs="unbounded"/>
  256. </xs:sequence>
  257. </xs:complexType>
  258. <!-- Slot Type -->
  259. <xs:complexType name="SlotType" mixed="true">
  260. <xs:sequence>
  261. <!-- Allow any elements from the current namespace except structural ones -->
  262. <xs:any namespace="##targetNamespace" processContents="lax" minOccurs="0" maxOccurs="unbounded">
  263. <xs:annotation>
  264. <xs:documentation>
  265. Allows any UI control elements except structural elements like:
  266. slot-overrides, slot, window, view-properties, attributes, etc.
  267. This provides flexibility for UI controls while maintaining structure.
  268. </xs:documentation>
  269. </xs:annotation>
  270. </xs:any>
  271. </xs:sequence>
  272. <xs:attribute name="name" type="xs:string" use="required"/>
  273. <xs:attribute name="visibility-binding" type="xs:string"/>
  274. <xs:attribute name="visibility-value" type="xs:string"/>
  275. <xs:attribute name="visibility-converter" type="xs:string"/>
  276. <xs:anyAttribute processContents="lax"/>
  277. </xs:complexType>
  278. </xs:schema>