types.xsd 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
  3. xmlns:p5TypeParam="http://biuro.biall-net.pl/p5/schema/typeParams"
  4. xmlns:p5Type="http://biuro.biall-net.pl/p5/schema/types" elementFormDefault="qualified"
  5. targetNamespace="http://biuro.biall-net.pl/p5/schema/types">
  6. <xs:import namespace="http://biuro.biall-net.pl/p5/schema/typeParams" schemaLocation="http://biuro.biall-net.pl/p5/schema/typeParams.xsd"/>
  7. <xs:simpleType name="string">
  8. <xs:restriction base="xs:string"/>
  9. </xs:simpleType>
  10. <xs:simpleType name="text">
  11. <xs:restriction base="xs:string"/>
  12. </xs:simpleType>
  13. <xs:simpleType name="enumeration">
  14. <xs:restriction base="xs:string"/>
  15. </xs:simpleType>
  16. <xs:simpleType name="set">
  17. <xs:annotation>
  18. <xs:documentation>
  19. Example appinfo for `CRM_PRZYPADEK`.`FORM_TREAT` field defined as set('', 'R', 'W', 'X', 'C', 'S', 'O', 'V', 'E'):
  20. <xs:appinfo>
  21. <p5TypeParam:param name="enumeration">
  22. <p5TypeParam:enumeration value="0" label="" description="Brak"/>
  23. <p5TypeParam:enumeration value="2" label="R" description="Read"/>
  24. <p5TypeParam:enumeration value="4" label="W" description="Write"/>
  25. <p5TypeParam:enumeration value="8" label="X" description="Execute"/>
  26. <p5TypeParam:enumeration value="16" label="C" description="Create"/>
  27. <p5TypeParam:enumeration value="32" label="S" description="..."/>
  28. <p5TypeParam:enumeration value="64" label="O" description="..."/>
  29. <p5TypeParam:enumeration value="124" label="V" description="..."/>
  30. <p5TypeParam:enumeration value="256" label="E" description="Export"/>
  31. </p5TypeParam:param>
  32. </xs:appinfo>
  33. SELECT ID, `FORM_TREAT`, CAST(`FORM_TREAT` AS UNSIGNED) FROM `CRM_PRZYPADEK`;
  34. IF 8 == 'X' THEN
  35. insert into `CRM_PRZYPADEK`(`FORM_TREAT`) values('X');
  36. IS EQUAL TO
  37. insert into `CRM_PRZYPADEK`(`FORM_TREAT`) values(8);
  38. </xs:documentation>
  39. </xs:annotation>
  40. <xs:restriction base="xs:integer"/>
  41. </xs:simpleType>
  42. <xs:simpleType name="integer">
  43. <xs:restriction base="xs:integer"/>
  44. </xs:simpleType>
  45. <xs:simpleType name="decimal">
  46. <xs:restriction base="xs:decimal"/>
  47. </xs:simpleType>
  48. <xs:simpleType name="double">
  49. <xs:restriction base="xs:double"/>
  50. </xs:simpleType>
  51. <xs:simpleType name="float">
  52. <xs:restriction base="xs:double"/>
  53. </xs:simpleType>
  54. <xs:simpleType name="binary">
  55. <xs:restriction base="xs:hexBinary"/>
  56. </xs:simpleType>
  57. <xs:simpleType name="hexBinary">
  58. <xs:restriction base="xs:hexBinary"/>
  59. </xs:simpleType>
  60. <xs:simpleType name="date">
  61. <xs:union memberTypes="xs:date p5Type:dateZero"/>
  62. </xs:simpleType>
  63. <xs:simpleType name="dateZero">
  64. <xs:restriction base="xs:string">
  65. <xs:enumeration value="0000-00-00"/>
  66. <xs:enumeration value="CURRENT_TIMESTAMP"/>
  67. </xs:restriction>
  68. </xs:simpleType>
  69. <xs:simpleType name="dateTime">
  70. <xs:union memberTypes="xs:dateTime p5Type:dateTimeZero"/>
  71. </xs:simpleType>
  72. <xs:simpleType name="dateTimeZero">
  73. <xs:restriction base="xs:string">
  74. <xs:enumeration value="0000-00-00 00:00:00"/>
  75. <xs:enumeration value="CURRENT_TIMESTAMP"/>
  76. </xs:restriction>
  77. </xs:simpleType>
  78. <xs:simpleType name="time">
  79. <xs:union memberTypes="xs:time p5Type:timeZero"/>
  80. </xs:simpleType>
  81. <xs:simpleType name="timeZero">
  82. <xs:restriction base="xs:string">
  83. <xs:enumeration value="00:00:00"/>
  84. <xs:enumeration value="CURRENT_TIMESTAMP"/>
  85. </xs:restriction>
  86. </xs:simpleType>
  87. <xs:simpleType name="year">
  88. <xs:union memberTypes="xs:gYear p5Type:yearZero"/>
  89. </xs:simpleType>
  90. <xs:simpleType name="yearZero">
  91. <xs:restriction base="xs:string">
  92. <xs:enumeration value="0000"/>
  93. <xs:enumeration value="CURRENT_TIMESTAMP"/>
  94. </xs:restriction>
  95. </xs:simpleType>
  96. <!--
  97. TODO: Geometry
  98. TODO: MultiPolygon
  99. TODO: MultiPoint
  100. TODO: MultiLineString
  101. TODO: GeometryCollection
  102. <gml:MultiPolygon>
  103. <gml:polygonMember>
  104. <gml:Polygon>
  105. ...
  106. -->
  107. <xs:simpleType name="geometry">
  108. <xs:restriction base="xs:string"/>
  109. </xs:simpleType>
  110. <xs:simpleType name="polygon">
  111. <xs:restriction base="xs:string">
  112. <xs:pattern value="(\-?\d+\.?\d*,-?\d+\.?\d*)( (\-?\d+\.?\d*,-?\d+\.?\d*))+"/>
  113. </xs:restriction>
  114. </xs:simpleType>
  115. <xs:simpleType name="point">
  116. <xs:restriction base="xs:string">
  117. <xs:pattern value="\-?\d\.?\d*,\-?\d\.?\d*"/>
  118. </xs:restriction>
  119. </xs:simpleType>
  120. <xs:simpleType name="lineString">
  121. <xs:restriction base="xs:string">
  122. <xs:pattern value="(\-?\d+\.?\d*,\-?\d+\.?\d*)( (\-?\d+\.?\d*,\-?\d+\.?\d*))+"/>
  123. </xs:restriction>
  124. </xs:simpleType>
  125. </xs:schema>