Commit | Line | Data |
---|---|---|
970ed795 EL |
1 | /******************************************************************************* |
2 | * Copyright Ericsson Telecom AB | |
3 | * | |
4 | * XSD to TTCN-3 Translator | |
5 | * | |
6 | * All rights reserved. This program and the accompanying materials | |
7 | * are made available under the terms of the Eclipse Public License v1.0 | |
8 | * which accompanies this distribution, and is available at | |
9 | * http://www.eclipse.org/legal/epl-v10.html | |
10 | *******************************************************************************/ | |
11 | // | |
12 | // File: http_www_XmlTest_org_po_e.ttcn | |
13 | // Description: | |
14 | // References: | |
15 | // Rev: | |
16 | // Prodnr: | |
17 | // Updated: Thu Sep 5 17:34:55 2013 | |
18 | // Contact: http://ttcn.ericsson.se | |
19 | // | |
20 | //////////////////////////////////////////////////////////////////////////////// | |
21 | // Generated from file(s): | |
22 | // - po.xsd | |
23 | // /* xml version = "1.0" */ | |
3f84031e | 24 | // /* targetnamespace = "http://www.XmlTest.org/po/e" */ |
970ed795 EL |
25 | //////////////////////////////////////////////////////////////////////////////// |
26 | // Modification header(s): | |
27 | //----------------------------------------------------------------------------- | |
28 | // Modified by: | |
29 | // Modification date: | |
30 | // Description: | |
31 | // Modification contact: | |
32 | //------------------------------------------------------------------------------ | |
33 | //////////////////////////////////////////////////////////////////////////////// | |
34 | ||
35 | ||
3f84031e | 36 | module http_www_XmlTest_org_po { |
970ed795 EL |
37 | |
38 | ||
39 | import from XSD all; | |
40 | ||
41 | ||
42 | /* Purchase order schema for Example.com. | |
43 | Copyright 2000 Example.com. All rights reserved. */ | |
44 | ||
45 | ||
46 | type PurchaseOrderType PurchaseOrder | |
47 | with { | |
3f84031e | 48 | variant "name as uncapitalized"; |
49 | variant "element"; | |
970ed795 EL |
50 | }; |
51 | ||
52 | ||
53 | type XSD.String Comment | |
54 | with { | |
3f84031e | 55 | variant "name as uncapitalized"; |
56 | variant "element"; | |
970ed795 EL |
57 | }; |
58 | ||
59 | ||
60 | type record PurchaseOrderType | |
61 | { | |
62 | XSD.Date orderDate optional, | |
63 | USAddress shipTo, | |
64 | USAddress billTo, | |
65 | Comment comment optional, | |
66 | Items items | |
67 | } | |
68 | with { | |
3f84031e | 69 | variant (orderDate) "attribute"; |
970ed795 EL |
70 | }; |
71 | ||
72 | ||
73 | type record USAddress | |
74 | { | |
3f84031e | 75 | XSD.NMTOKEN country ("US") optional, |
970ed795 EL |
76 | XSD.String name, |
77 | XSD.String street, | |
78 | XSD.String city, | |
79 | XSD.String state, | |
80 | XSD.Decimal zip | |
81 | } | |
82 | with { | |
3f84031e | 83 | variant (country) "defaultForEmpty as 'US'"; |
84 | variant (country) "attribute"; | |
970ed795 EL |
85 | }; |
86 | ||
87 | ||
88 | type record Items | |
89 | { | |
90 | record of record { | |
91 | SKU partNum, | |
92 | XSD.String productName, | |
93 | XSD.PositiveInteger quantity (1 .. !100), | |
94 | XSD.Decimal uSPrice, | |
95 | Comment comment optional, | |
96 | XSD.Date shipDate optional | |
97 | } item_list | |
98 | } | |
99 | with { | |
3f84031e | 100 | variant (item_list) "untagged"; |
101 | variant (item_list[-]) "name as 'item'"; | |
102 | variant (item_list[-].partNum) "attribute"; | |
103 | variant (item_list[-].uSPrice) "name as capitalized"; | |
970ed795 EL |
104 | }; |
105 | ||
106 | ||
107 | /* Stock Keeping Unit, a code for identifying products */ | |
108 | ||
109 | ||
3f84031e | 110 | type XSD.String SKU (pattern "\d#(3)-[A-Z]#(2)"); |
970ed795 EL |
111 | |
112 | ||
113 | } | |
114 | with { | |
3f84031e | 115 | encode "XML"; |
116 | variant "namespace as 'http://www.XmlTest.org/po'"; | |
117 | variant "controlNamespace 'http://www.w3.org/2001/XMLSchema-instance' prefix 'xsi'"; | |
970ed795 | 118 | } |