eav_attributes.xsd 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. /**
  4. * Copyright © Magento, Inc. All rights reserved.
  5. * See COPYING.txt for license details.
  6. */
  7. -->
  8. <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
  9. <xs:element name="config">
  10. <xs:complexType>
  11. <xs:sequence>
  12. <xs:element name="entity" type="entityDeclaration" minOccurs="1" maxOccurs="unbounded">
  13. <xs:unique name="uniqueAttributeCode">
  14. <xs:annotation>
  15. <xs:documentation>
  16. Attribute code must be unique
  17. </xs:documentation>
  18. </xs:annotation>
  19. <xs:selector xpath="attribute" />
  20. <xs:field xpath="@code" />
  21. </xs:unique>
  22. </xs:element>
  23. </xs:sequence>
  24. </xs:complexType>
  25. <xs:unique name="uniqueEntityType">
  26. <xs:annotation>
  27. <xs:documentation>
  28. Entity type must be unique
  29. </xs:documentation>
  30. </xs:annotation>
  31. <xs:selector xpath="entity" />
  32. <xs:field xpath="@type" />
  33. </xs:unique>
  34. </xs:element>
  35. <xs:complexType name="entityDeclaration">
  36. <xs:annotation>
  37. <xs:documentation>
  38. Entity declaration
  39. </xs:documentation>
  40. </xs:annotation>
  41. <xs:sequence>
  42. <xs:element name="attribute" type="attributeDeclaration" minOccurs="1" maxOccurs="unbounded">
  43. <xs:unique name="uniqueFieldCode">
  44. <xs:annotation>
  45. <xs:documentation>
  46. Field code must be unique
  47. </xs:documentation>
  48. </xs:annotation>
  49. <xs:selector xpath="field" />
  50. <xs:field xpath="@code" />
  51. </xs:unique>
  52. </xs:element>
  53. </xs:sequence>
  54. <xs:attribute name="type" type="identifierType" use="required" />
  55. </xs:complexType>
  56. <xs:complexType name="attributeDeclaration">
  57. <xs:annotation>
  58. <xs:documentation>
  59. Attribute declaration
  60. </xs:documentation>
  61. </xs:annotation>
  62. <xs:sequence>
  63. <xs:element name="field" type="fieldDeclaration" minOccurs="1" maxOccurs="unbounded" />
  64. </xs:sequence>
  65. <xs:attribute name="code" type="identifierType" use="required" />
  66. </xs:complexType>
  67. <xs:complexType name="fieldDeclaration">
  68. <xs:annotation>
  69. <xs:documentation>
  70. Field declaration
  71. </xs:documentation>
  72. </xs:annotation>
  73. <xs:attribute name="code" type="identifierType" use="required" />
  74. <xs:attribute name="locked" type="xs:boolean" use="required" />
  75. </xs:complexType>
  76. <xs:simpleType name="identifierType">
  77. <xs:annotation>
  78. <xs:documentation>
  79. Identifier can contain only [a-z_].
  80. </xs:documentation>
  81. </xs:annotation>
  82. <xs:restriction base="xs:string">
  83. <xs:pattern value="[a-z_]+" />
  84. </xs:restriction>
  85. </xs:simpleType>
  86. </xs:schema>