-
Notifications
You must be signed in to change notification settings - Fork 0
/
product-annotated.xsd
48 lines (44 loc) · 1.59 KB
/
product-annotated.xsd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:ben="http://databene.org/benerator-0.7.0.xsd"
targetNamespace="demo/shop/product.xsd"
xmlns="demo/shop/product.xsd"
elementFormDefault="qualified">
<xs:simpleType name="ean13-type">
<xs:annotation><xs:appinfo>
<ben:type generator="org.databene.domain.product.EAN13Generator"/>
</xs:appinfo></xs:annotation>
<xs:restriction base="xs:string">
<xs:pattern value="[0-9]{13}" />
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="price-type">
<xs:annotation><xs:appinfo>
<ben:type min="0.49" max="99.99" granularity="0.10" distribution="cumulated"/>
</xs:appinfo></xs:annotation>
<xs:restriction base="xs:decimal">
<xs:minInclusive value="0"/>
<xs:totalDigits value="8" />
<xs:fractionDigits value="2" />
</xs:restriction>
</xs:simpleType>
<xs:element name="product">
<xs:complexType>
<xs:sequence>
<xs:element name="name" type="xs:string">
<xs:annotation><xs:appinfo>
<ben:type values="'Apples','Bananas','Cherries'"/>
</xs:appinfo></xs:annotation>
</xs:element>
</xs:sequence>
<xs:attribute name="ean_code" type="ean13-type" use="required"/>
<xs:attribute name="price" type="price-type" use="required"/>
<xs:attribute name="manufacturer" type="xs:string" use="required">
<xs:annotation><xs:appinfo>
<ben:attribute pattern="[BDFGH][aeiou][lr][tpmn] (Inc\.|Corp\.)"/>
</xs:appinfo></xs:annotation>
</xs:attribute>
</xs:complexType>
</xs:element>
</xs:schema>