facturx-schematron 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,1451 @@
1
+ <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
+ <!-- Factur-X release metadata
3
+ Version: 1.09.2
4
+ Release date: 2026-08-04
5
+ Effective date: 2026-09-01
6
+ -->
7
+ <xsl:stylesheet xmlns:svrl="http://purl.oclc.org/dsdl/svrl" xmlns:iso="http://purl.oclc.org/dsdl/schematron" xmlns:qdt="urn:un:unece:uncefact:data:standard:QualifiedDataType:100" xmlns:ram="urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100" xmlns:rsm="urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100" xmlns:saxon="http://saxon.sf.net/" xmlns:schold="http://www.ascc.net/xml/schematron" xmlns:udt="urn:un:unece:uncefact:data:standard:UnqualifiedDataType:100" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">
8
+ <!--Implementers: please note that overriding process-prolog or process-root is
9
+ the preferred method for meta-stylesheets to use where possible. -->
10
+
11
+ <xsl:param name="archiveDirParameter" />
12
+ <xsl:param name="archiveNameParameter" />
13
+ <xsl:param name="fileNameParameter" />
14
+ <xsl:param name="fileDirParameter" />
15
+ <xsl:variable name="document-uri">
16
+ <xsl:value-of select="document-uri(/)" />
17
+ </xsl:variable>
18
+
19
+ <!--PHASES-->
20
+
21
+
22
+ <!--PROLOG-->
23
+ <xsl:output indent="yes" method="xml" omit-xml-declaration="no" standalone="yes" />
24
+
25
+ <!--XSD TYPES FOR XSLT2-->
26
+
27
+
28
+ <!--KEYS AND FUNCTIONS-->
29
+
30
+
31
+ <!--DEFAULT RULES-->
32
+
33
+
34
+ <!--MODE: SCHEMATRON-SELECT-FULL-PATH-->
35
+ <!--This mode can be used to generate an ugly though full XPath for locators-->
36
+ <xsl:template match="*" mode="schematron-select-full-path">
37
+ <xsl:apply-templates mode="schematron-get-full-path" select="." />
38
+ </xsl:template>
39
+
40
+ <!--MODE: SCHEMATRON-FULL-PATH-->
41
+ <!--This mode can be used to generate an ugly though full XPath for locators-->
42
+ <xsl:template match="*" mode="schematron-get-full-path">
43
+ <xsl:apply-templates mode="schematron-get-full-path" select="parent::*" />
44
+ <xsl:text>/</xsl:text>
45
+ <xsl:choose>
46
+ <xsl:when test="namespace-uri()=''">
47
+ <xsl:value-of select="name()" />
48
+ </xsl:when>
49
+ <xsl:otherwise>
50
+ <xsl:text>*:</xsl:text>
51
+ <xsl:value-of select="local-name()" />
52
+ <xsl:text>[namespace-uri()='</xsl:text>
53
+ <xsl:value-of select="namespace-uri()" />
54
+ <xsl:text>']</xsl:text>
55
+ </xsl:otherwise>
56
+ </xsl:choose>
57
+ <xsl:variable name="preceding" select="count(preceding-sibling::*[local-name()=local-name(current()) and namespace-uri() = namespace-uri(current())])" />
58
+ <xsl:text>[</xsl:text>
59
+ <xsl:value-of select="1+ $preceding" />
60
+ <xsl:text>]</xsl:text>
61
+ </xsl:template>
62
+ <xsl:template match="@*" mode="schematron-get-full-path">
63
+ <xsl:apply-templates mode="schematron-get-full-path" select="parent::*" />
64
+ <xsl:text>/</xsl:text>
65
+ <xsl:choose>
66
+ <xsl:when test="namespace-uri()=''">@<xsl:value-of select="name()" />
67
+ </xsl:when>
68
+ <xsl:otherwise>
69
+ <xsl:text>@*[local-name()='</xsl:text>
70
+ <xsl:value-of select="local-name()" />
71
+ <xsl:text>' and namespace-uri()='</xsl:text>
72
+ <xsl:value-of select="namespace-uri()" />
73
+ <xsl:text>']</xsl:text>
74
+ </xsl:otherwise>
75
+ </xsl:choose>
76
+ </xsl:template>
77
+
78
+ <!--MODE: SCHEMATRON-FULL-PATH-2-->
79
+ <!--This mode can be used to generate prefixed XPath for humans-->
80
+ <xsl:template match="node() | @*" mode="schematron-get-full-path-2">
81
+ <xsl:for-each select="ancestor-or-self::*">
82
+ <xsl:text>/</xsl:text>
83
+ <xsl:value-of select="name(.)" />
84
+ <xsl:if test="preceding-sibling::*[name(.)=name(current())]">
85
+ <xsl:text>[</xsl:text>
86
+ <xsl:value-of select="count(preceding-sibling::*[name(.)=name(current())])+1" />
87
+ <xsl:text>]</xsl:text>
88
+ </xsl:if>
89
+ </xsl:for-each>
90
+ <xsl:if test="not(self::*)">
91
+ <xsl:text />/@<xsl:value-of select="name(.)" />
92
+ </xsl:if>
93
+ </xsl:template>
94
+ <!--MODE: SCHEMATRON-FULL-PATH-3-->
95
+ <!--This mode can be used to generate prefixed XPath for humans
96
+ (Top-level element has index)-->
97
+
98
+ <xsl:template match="node() | @*" mode="schematron-get-full-path-3">
99
+ <xsl:for-each select="ancestor-or-self::*">
100
+ <xsl:text>/</xsl:text>
101
+ <xsl:value-of select="name(.)" />
102
+ <xsl:if test="parent::*">
103
+ <xsl:text>[</xsl:text>
104
+ <xsl:value-of select="count(preceding-sibling::*[name(.)=name(current())])+1" />
105
+ <xsl:text>]</xsl:text>
106
+ </xsl:if>
107
+ </xsl:for-each>
108
+ <xsl:if test="not(self::*)">
109
+ <xsl:text />/@<xsl:value-of select="name(.)" />
110
+ </xsl:if>
111
+ </xsl:template>
112
+
113
+ <!--MODE: GENERATE-ID-FROM-PATH -->
114
+ <xsl:template match="/" mode="generate-id-from-path" />
115
+ <xsl:template match="text()" mode="generate-id-from-path">
116
+ <xsl:apply-templates mode="generate-id-from-path" select="parent::*" />
117
+ <xsl:value-of select="concat('.text-', 1+count(preceding-sibling::text()), '-')" />
118
+ </xsl:template>
119
+ <xsl:template match="comment()" mode="generate-id-from-path">
120
+ <xsl:apply-templates mode="generate-id-from-path" select="parent::*" />
121
+ <xsl:value-of select="concat('.comment-', 1+count(preceding-sibling::comment()), '-')" />
122
+ </xsl:template>
123
+ <xsl:template match="processing-instruction()" mode="generate-id-from-path">
124
+ <xsl:apply-templates mode="generate-id-from-path" select="parent::*" />
125
+ <xsl:value-of select="concat('.processing-instruction-', 1+count(preceding-sibling::processing-instruction()), '-')" />
126
+ </xsl:template>
127
+ <xsl:template match="@*" mode="generate-id-from-path">
128
+ <xsl:apply-templates mode="generate-id-from-path" select="parent::*" />
129
+ <xsl:value-of select="concat('.@', name())" />
130
+ </xsl:template>
131
+ <xsl:template match="*" mode="generate-id-from-path" priority="-0.5">
132
+ <xsl:apply-templates mode="generate-id-from-path" select="parent::*" />
133
+ <xsl:text>.</xsl:text>
134
+ <xsl:value-of select="concat('.',name(),'-',1+count(preceding-sibling::*[name()=name(current())]),'-')" />
135
+ </xsl:template>
136
+
137
+ <!--MODE: GENERATE-ID-2 -->
138
+ <xsl:template match="/" mode="generate-id-2">U</xsl:template>
139
+ <xsl:template match="*" mode="generate-id-2" priority="2">
140
+ <xsl:text>U</xsl:text>
141
+ <xsl:number count="*" level="multiple" />
142
+ </xsl:template>
143
+ <xsl:template match="node()" mode="generate-id-2">
144
+ <xsl:text>U.</xsl:text>
145
+ <xsl:number count="*" level="multiple" />
146
+ <xsl:text>n</xsl:text>
147
+ <xsl:number count="node()" />
148
+ </xsl:template>
149
+ <xsl:template match="@*" mode="generate-id-2">
150
+ <xsl:text>U.</xsl:text>
151
+ <xsl:number count="*" level="multiple" />
152
+ <xsl:text>_</xsl:text>
153
+ <xsl:value-of select="string-length(local-name(.))" />
154
+ <xsl:text>_</xsl:text>
155
+ <xsl:value-of select="translate(name(),':','.')" />
156
+ </xsl:template>
157
+ <!--Strip characters--> <xsl:template match="text()" priority="-1" />
158
+
159
+ <!--SCHEMA SETUP-->
160
+ <xsl:template match="/">
161
+ <svrl:schematron-output schemaVersion="iso" title="Schema for Factur-X; 1.09.2; Accounting, MINIMUM">
162
+ <xsl:comment>
163
+ <xsl:value-of select="$archiveDirParameter" />  
164
+ <xsl:value-of select="$archiveNameParameter" />  
165
+ <xsl:value-of select="$fileNameParameter" />  
166
+ <xsl:value-of select="$fileDirParameter" />
167
+ </xsl:comment>
168
+ <svrl:ns-prefix-in-attribute-values prefix="rsm" uri="urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100" />
169
+ <svrl:ns-prefix-in-attribute-values prefix="qdt" uri="urn:un:unece:uncefact:data:standard:QualifiedDataType:100" />
170
+ <svrl:ns-prefix-in-attribute-values prefix="ram" uri="urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100" />
171
+ <svrl:ns-prefix-in-attribute-values prefix="udt" uri="urn:un:unece:uncefact:data:standard:UnqualifiedDataType:100" />
172
+ <svrl:active-pattern>
173
+ <xsl:attribute name="document">
174
+ <xsl:value-of select="document-uri(/)" />
175
+ </xsl:attribute>
176
+ <xsl:attribute name="documents">
177
+ <xsl:value-of select="document-uri(/)" />
178
+ </xsl:attribute>
179
+ <xsl:apply-templates />
180
+ </svrl:active-pattern>
181
+ <xsl:apply-templates mode="M5" select="/" />
182
+ <svrl:active-pattern>
183
+ <xsl:attribute name="document">
184
+ <xsl:value-of select="document-uri(/)" />
185
+ </xsl:attribute>
186
+ <xsl:attribute name="documents">
187
+ <xsl:value-of select="document-uri(/)" />
188
+ </xsl:attribute>
189
+ <xsl:apply-templates />
190
+ </svrl:active-pattern>
191
+ <xsl:apply-templates mode="M6" select="/" />
192
+ <svrl:active-pattern>
193
+ <xsl:attribute name="document">
194
+ <xsl:value-of select="document-uri(/)" />
195
+ </xsl:attribute>
196
+ <xsl:attribute name="documents">
197
+ <xsl:value-of select="document-uri(/)" />
198
+ </xsl:attribute>
199
+ <xsl:apply-templates />
200
+ </svrl:active-pattern>
201
+ <xsl:apply-templates mode="M7" select="/" />
202
+ <svrl:active-pattern>
203
+ <xsl:attribute name="document">
204
+ <xsl:value-of select="document-uri(/)" />
205
+ </xsl:attribute>
206
+ <xsl:attribute name="documents">
207
+ <xsl:value-of select="document-uri(/)" />
208
+ </xsl:attribute>
209
+ <xsl:apply-templates />
210
+ </svrl:active-pattern>
211
+ <xsl:apply-templates mode="M8" select="/" />
212
+ <svrl:active-pattern>
213
+ <xsl:attribute name="document">
214
+ <xsl:value-of select="document-uri(/)" />
215
+ </xsl:attribute>
216
+ <xsl:attribute name="documents">
217
+ <xsl:value-of select="document-uri(/)" />
218
+ </xsl:attribute>
219
+ <xsl:apply-templates />
220
+ </svrl:active-pattern>
221
+ <xsl:apply-templates mode="M9" select="/" />
222
+ </svrl:schematron-output>
223
+ </xsl:template>
224
+
225
+ <!--SCHEMATRON PATTERNS-->
226
+ <svrl:text>Schema for Factur-X; 1.09.2; Accounting, MINIMUM</svrl:text>
227
+
228
+ <!--PATTERN -->
229
+
230
+
231
+ <!--RULE -->
232
+ <xsl:template match="//ram:SellerTradeParty" mode="M5" priority="1000">
233
+ <svrl:fired-rule context="//ram:SellerTradeParty" />
234
+
235
+ <!--ASSERT -->
236
+ <xsl:choose>
237
+ <xsl:when test="(ram:ID) or (ram:GlobalID) or (ram:SpecifiedLegalOrganization/ram:ID) or (ram:SpecifiedTaxRegistration/ram:ID[@schemeID='VA'])" />
238
+ <xsl:otherwise>
239
+ <svrl:failed-assert test="(ram:ID) or (ram:GlobalID) or (ram:SpecifiedLegalOrganization/ram:ID) or (ram:SpecifiedTaxRegistration/ram:ID[@schemeID='VA'])">
240
+ <xsl:attribute name="id">BR-CO-26</xsl:attribute>
241
+ <xsl:attribute name="location">
242
+ <xsl:apply-templates mode="schematron-select-full-path" select="." />
243
+ </xsl:attribute>
244
+ <svrl:text>
245
+ [BR-CO-26]-In order for the buyer to automatically identify a supplier, the Seller identifier (BT-29), the Seller legal registration identifier (BT-30) and/or the Seller VAT identifier (BT-31) shall be present.</svrl:text>
246
+ </svrl:failed-assert>
247
+ </xsl:otherwise>
248
+ </xsl:choose>
249
+ <xsl:apply-templates mode="M5" select="@*|*" />
250
+ </xsl:template>
251
+ <xsl:template match="text()" mode="M5" priority="-1" />
252
+ <xsl:template match="@*|node()" mode="M5" priority="-2">
253
+ <xsl:apply-templates mode="M5" select="@*|*" />
254
+ </xsl:template>
255
+
256
+ <!--PATTERN -->
257
+
258
+
259
+ <!--RULE -->
260
+ <xsl:template match="//ram:SpecifiedTaxRegistration/ram:ID[@schemeID='VA']" mode="M6" priority="1000">
261
+ <svrl:fired-rule context="//ram:SpecifiedTaxRegistration/ram:ID[@schemeID='VA']" />
262
+
263
+ <!--ASSERT -->
264
+ <xsl:choose>
265
+ <xsl:when test="contains(' 1A AD AE AF AG AI AL AM AN AO AQ AR AS AT AU AW AX AZ BA BB BD BE BF BG BH BI BL BJ BM BN BO BQ BR BS BT BV BW BY BZ CA CC CD CF CG CH CI CK CL CM CN CO CR CU CV CW CX CY CZ DE DJ DK DM DO DZ EC EE EG EH EL ER ES ET FI FJ FK FM FO FR GA GB GD GE GF GG GH GI GL GM GN GP GQ GR GS GT GU GW GY HK HM HN HR HT HU ID IE IL IM IN IO IQ IR IS IT JE JM JO JP KE KG KH KI KM KN KP KR KW KY KZ LA LB LC LI LK LR LS LT LU LV LY MA MC MD ME MF MG MH MK ML MM MN MO MP MQ MR MS MT MU MV MW MX MY MZ NA NC NE NF NG NI NL NO NP NR NU NZ OM PA PE PF PG PH PK PL PM PN PR PS PT PW PY QA RE RO RS RU RW SA SB SC SD SE SG SH SI SJ SK SL SM SN SO SR ST SV SX SY SZ TC TD TF TG TH TJ TK TL TM TN TO TR TT TV TW TZ UA UG UM US UY UZ VA VC VE VG VI VN VU WF WS XI YE YT ZA ZM ZW ', concat(' ', substring(.,1,2), ' '))" />
266
+ <xsl:otherwise>
267
+ <svrl:failed-assert test="contains(' 1A AD AE AF AG AI AL AM AN AO AQ AR AS AT AU AW AX AZ BA BB BD BE BF BG BH BI BL BJ BM BN BO BQ BR BS BT BV BW BY BZ CA CC CD CF CG CH CI CK CL CM CN CO CR CU CV CW CX CY CZ DE DJ DK DM DO DZ EC EE EG EH EL ER ES ET FI FJ FK FM FO FR GA GB GD GE GF GG GH GI GL GM GN GP GQ GR GS GT GU GW GY HK HM HN HR HT HU ID IE IL IM IN IO IQ IR IS IT JE JM JO JP KE KG KH KI KM KN KP KR KW KY KZ LA LB LC LI LK LR LS LT LU LV LY MA MC MD ME MF MG MH MK ML MM MN MO MP MQ MR MS MT MU MV MW MX MY MZ NA NC NE NF NG NI NL NO NP NR NU NZ OM PA PE PF PG PH PK PL PM PN PR PS PT PW PY QA RE RO RS RU RW SA SB SC SD SE SG SH SI SJ SK SL SM SN SO SR ST SV SX SY SZ TC TD TF TG TH TJ TK TL TM TN TO TR TT TV TW TZ UA UG UM US UY UZ VA VC VE VG VI VN VU WF WS XI YE YT ZA ZM ZW ', concat(' ', substring(.,1,2), ' '))">
268
+ <xsl:attribute name="id">BR-CO-09</xsl:attribute>
269
+ <xsl:attribute name="location">
270
+ <xsl:apply-templates mode="schematron-select-full-path" select="." />
271
+ </xsl:attribute>
272
+ <svrl:text>
273
+ [BR-CO-09]-The Seller VAT identifier (BT-31), the Seller tax representative VAT identifier (BT-63) and the Buyer VAT identifier (BT-48) shall have a prefix in accordance with ISO code ISO 3166-1 alpha-2 by which the country of issue may be identified. Nevertheless, Greece may use the prefix ‘EL’.</svrl:text>
274
+ </svrl:failed-assert>
275
+ </xsl:otherwise>
276
+ </xsl:choose>
277
+ <xsl:apply-templates mode="M6" select="@*|*" />
278
+ </xsl:template>
279
+ <xsl:template match="text()" mode="M6" priority="-1" />
280
+ <xsl:template match="@*|node()" mode="M6" priority="-2">
281
+ <xsl:apply-templates mode="M6" select="@*|*" />
282
+ </xsl:template>
283
+
284
+ <!--PATTERN -->
285
+
286
+
287
+ <!--RULE -->
288
+ <xsl:template match="//ram:SpecifiedTradeSettlementHeaderMonetarySummation" mode="M7" priority="1000">
289
+ <svrl:fired-rule context="//ram:SpecifiedTradeSettlementHeaderMonetarySummation" />
290
+
291
+ <!--ASSERT -->
292
+ <xsl:choose>
293
+ <xsl:when test="(ram:TaxBasisTotalAmount)" />
294
+ <xsl:otherwise>
295
+ <svrl:failed-assert test="(ram:TaxBasisTotalAmount)">
296
+ <xsl:attribute name="id">BR-13</xsl:attribute>
297
+ <xsl:attribute name="location">
298
+ <xsl:apply-templates mode="schematron-select-full-path" select="." />
299
+ </xsl:attribute>
300
+ <svrl:text>
301
+ [BR-13]-An Invoice shall have the Invoice total amount without VAT (BT-109).</svrl:text>
302
+ </svrl:failed-assert>
303
+ </xsl:otherwise>
304
+ </xsl:choose>
305
+
306
+ <!--ASSERT -->
307
+ <xsl:choose>
308
+ <xsl:when test="(ram:GrandTotalAmount)" />
309
+ <xsl:otherwise>
310
+ <svrl:failed-assert test="(ram:GrandTotalAmount)">
311
+ <xsl:attribute name="id">BR-14</xsl:attribute>
312
+ <xsl:attribute name="location">
313
+ <xsl:apply-templates mode="schematron-select-full-path" select="." />
314
+ </xsl:attribute>
315
+ <svrl:text>
316
+ [BR-14]-An Invoice shall have the Invoice total amount with VAT (BT-112).</svrl:text>
317
+ </svrl:failed-assert>
318
+ </xsl:otherwise>
319
+ </xsl:choose>
320
+
321
+ <!--ASSERT -->
322
+ <xsl:choose>
323
+ <xsl:when test="(ram:DuePayableAmount)" />
324
+ <xsl:otherwise>
325
+ <svrl:failed-assert test="(ram:DuePayableAmount)">
326
+ <xsl:attribute name="id">BR-15</xsl:attribute>
327
+ <xsl:attribute name="location">
328
+ <xsl:apply-templates mode="schematron-select-full-path" select="." />
329
+ </xsl:attribute>
330
+ <svrl:text>
331
+ [BR-15]-An Invoice shall have the Amount due for payment (BT-115).</svrl:text>
332
+ </svrl:failed-assert>
333
+ </xsl:otherwise>
334
+ </xsl:choose>
335
+
336
+ <!--ASSERT -->
337
+ <xsl:choose>
338
+ <xsl:when test="string-length(substring-after(ram:TaxBasisTotalAmount,'.'))&lt;=2" />
339
+ <xsl:otherwise>
340
+ <svrl:failed-assert test="string-length(substring-after(ram:TaxBasisTotalAmount,'.'))&lt;=2">
341
+ <xsl:attribute name="id">BR-DEC-12</xsl:attribute>
342
+ <xsl:attribute name="location">
343
+ <xsl:apply-templates mode="schematron-select-full-path" select="." />
344
+ </xsl:attribute>
345
+ <svrl:text>
346
+ [BR-DEC-12]-The allowed maximum number of decimals for the Invoice total amount without VAT (BT-109) is 2.</svrl:text>
347
+ </svrl:failed-assert>
348
+ </xsl:otherwise>
349
+ </xsl:choose>
350
+
351
+ <!--ASSERT -->
352
+ <xsl:choose>
353
+ <xsl:when test="not(ram:TaxTotalAmount) or ram:TaxTotalAmount[(@currencyID =/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:InvoiceCurrencyCode and . = round(. * 100) div 100) or not (@currencyID =/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:InvoiceCurrencyCode)]" />
354
+ <xsl:otherwise>
355
+ <svrl:failed-assert test="not(ram:TaxTotalAmount) or ram:TaxTotalAmount[(@currencyID =/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:InvoiceCurrencyCode and . = round(. * 100) div 100) or not (@currencyID =/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:InvoiceCurrencyCode)]">
356
+ <xsl:attribute name="id">BR-DEC-13</xsl:attribute>
357
+ <xsl:attribute name="location">
358
+ <xsl:apply-templates mode="schematron-select-full-path" select="." />
359
+ </xsl:attribute>
360
+ <svrl:text>
361
+ [BR-DEC-13]-The allowed maximum number of decimals for the Invoice total VAT amount (BT-110) is 2.</svrl:text>
362
+ </svrl:failed-assert>
363
+ </xsl:otherwise>
364
+ </xsl:choose>
365
+
366
+ <!--ASSERT -->
367
+ <xsl:choose>
368
+ <xsl:when test="string-length(substring-after(ram:GrandTotalAmount,'.'))&lt;=2" />
369
+ <xsl:otherwise>
370
+ <svrl:failed-assert test="string-length(substring-after(ram:GrandTotalAmount,'.'))&lt;=2">
371
+ <xsl:attribute name="id">BR-DEC-14</xsl:attribute>
372
+ <xsl:attribute name="location">
373
+ <xsl:apply-templates mode="schematron-select-full-path" select="." />
374
+ </xsl:attribute>
375
+ <svrl:text>
376
+ [BR-DEC-14]-The allowed maximum number of decimals for the Invoice total amount with VAT (BT-112) is 2.</svrl:text>
377
+ </svrl:failed-assert>
378
+ </xsl:otherwise>
379
+ </xsl:choose>
380
+
381
+ <!--ASSERT -->
382
+ <xsl:choose>
383
+ <xsl:when test="string-length(substring-after(ram:DuePayableAmount,'.'))&lt;=2" />
384
+ <xsl:otherwise>
385
+ <svrl:failed-assert test="string-length(substring-after(ram:DuePayableAmount,'.'))&lt;=2">
386
+ <xsl:attribute name="id">BR-DEC-18</xsl:attribute>
387
+ <xsl:attribute name="location">
388
+ <xsl:apply-templates mode="schematron-select-full-path" select="." />
389
+ </xsl:attribute>
390
+ <svrl:text>
391
+ [BR-DEC-18]-The allowed maximum number of decimals for the Amount due for payment (BT-115) is 2.</svrl:text>
392
+ </svrl:failed-assert>
393
+ </xsl:otherwise>
394
+ </xsl:choose>
395
+ <xsl:apply-templates mode="M7" select="@*|*" />
396
+ </xsl:template>
397
+ <xsl:template match="text()" mode="M7" priority="-1" />
398
+ <xsl:template match="@*|node()" mode="M7" priority="-2">
399
+ <xsl:apply-templates mode="M7" select="@*|*" />
400
+ </xsl:template>
401
+
402
+ <!--PATTERN -->
403
+
404
+
405
+ <!--RULE -->
406
+ <xsl:template match="/rsm:CrossIndustryInvoice" mode="M8" priority="1000">
407
+ <svrl:fired-rule context="/rsm:CrossIndustryInvoice" />
408
+
409
+ <!--ASSERT -->
410
+ <xsl:choose>
411
+ <xsl:when test="(rsm:ExchangedDocumentContext/ram:GuidelineSpecifiedDocumentContextParameter/ram:ID != '')" />
412
+ <xsl:otherwise>
413
+ <svrl:failed-assert test="(rsm:ExchangedDocumentContext/ram:GuidelineSpecifiedDocumentContextParameter/ram:ID != '')">
414
+ <xsl:attribute name="id">BR-01</xsl:attribute>
415
+ <xsl:attribute name="location">
416
+ <xsl:apply-templates mode="schematron-select-full-path" select="." />
417
+ </xsl:attribute>
418
+ <svrl:text>
419
+ [BR-01]-An Invoice shall have a Specification identifier (BT-24).</svrl:text>
420
+ </svrl:failed-assert>
421
+ </xsl:otherwise>
422
+ </xsl:choose>
423
+
424
+ <!--ASSERT -->
425
+ <xsl:choose>
426
+ <xsl:when test="(rsm:ExchangedDocument/ram:ID !='')" />
427
+ <xsl:otherwise>
428
+ <svrl:failed-assert test="(rsm:ExchangedDocument/ram:ID !='')">
429
+ <xsl:attribute name="id">BR-02</xsl:attribute>
430
+ <xsl:attribute name="location">
431
+ <xsl:apply-templates mode="schematron-select-full-path" select="." />
432
+ </xsl:attribute>
433
+ <svrl:text>
434
+ [BR-02]-An Invoice shall have an Invoice number (BT-1).</svrl:text>
435
+ </svrl:failed-assert>
436
+ </xsl:otherwise>
437
+ </xsl:choose>
438
+
439
+ <!--ASSERT -->
440
+ <xsl:choose>
441
+ <xsl:when test="(rsm:ExchangedDocument/ram:IssueDateTime/udt:DateTimeString[@format='102']!='')" />
442
+ <xsl:otherwise>
443
+ <svrl:failed-assert test="(rsm:ExchangedDocument/ram:IssueDateTime/udt:DateTimeString[@format='102']!='')">
444
+ <xsl:attribute name="id">BR-03</xsl:attribute>
445
+ <xsl:attribute name="location">
446
+ <xsl:apply-templates mode="schematron-select-full-path" select="." />
447
+ </xsl:attribute>
448
+ <svrl:text>
449
+ [BR-03]-An Invoice shall have an Invoice issue date (BT-2).</svrl:text>
450
+ </svrl:failed-assert>
451
+ </xsl:otherwise>
452
+ </xsl:choose>
453
+
454
+ <!--ASSERT -->
455
+ <xsl:choose>
456
+ <xsl:when test="(rsm:ExchangedDocument/ram:TypeCode!='')" />
457
+ <xsl:otherwise>
458
+ <svrl:failed-assert test="(rsm:ExchangedDocument/ram:TypeCode!='')">
459
+ <xsl:attribute name="id">BR-04</xsl:attribute>
460
+ <xsl:attribute name="location">
461
+ <xsl:apply-templates mode="schematron-select-full-path" select="." />
462
+ </xsl:attribute>
463
+ <svrl:text>
464
+ [BR-04]-An Invoice shall have an Invoice type code (BT-3).</svrl:text>
465
+ </svrl:failed-assert>
466
+ </xsl:otherwise>
467
+ </xsl:choose>
468
+
469
+ <!--ASSERT -->
470
+ <xsl:choose>
471
+ <xsl:when test="(rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:InvoiceCurrencyCode!='')" />
472
+ <xsl:otherwise>
473
+ <svrl:failed-assert test="(rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:InvoiceCurrencyCode!='')">
474
+ <xsl:attribute name="id">BR-05</xsl:attribute>
475
+ <xsl:attribute name="location">
476
+ <xsl:apply-templates mode="schematron-select-full-path" select="." />
477
+ </xsl:attribute>
478
+ <svrl:text>
479
+ [BR-05]-An Invoice shall have an Invoice currency code (BT-5).</svrl:text>
480
+ </svrl:failed-assert>
481
+ </xsl:otherwise>
482
+ </xsl:choose>
483
+
484
+ <!--ASSERT -->
485
+ <xsl:choose>
486
+ <xsl:when test="(rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:SellerTradeParty/ram:Name!='')" />
487
+ <xsl:otherwise>
488
+ <svrl:failed-assert test="(rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:SellerTradeParty/ram:Name!='')">
489
+ <xsl:attribute name="id">BR-06</xsl:attribute>
490
+ <xsl:attribute name="location">
491
+ <xsl:apply-templates mode="schematron-select-full-path" select="." />
492
+ </xsl:attribute>
493
+ <svrl:text>
494
+ [BR-06]-An Invoice shall contain the Seller name (BT-27).</svrl:text>
495
+ </svrl:failed-assert>
496
+ </xsl:otherwise>
497
+ </xsl:choose>
498
+
499
+ <!--ASSERT -->
500
+ <xsl:choose>
501
+ <xsl:when test="(rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:BuyerTradeParty/ram:Name!='')" />
502
+ <xsl:otherwise>
503
+ <svrl:failed-assert test="(rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:BuyerTradeParty/ram:Name!='')">
504
+ <xsl:attribute name="id">BR-07</xsl:attribute>
505
+ <xsl:attribute name="location">
506
+ <xsl:apply-templates mode="schematron-select-full-path" select="." />
507
+ </xsl:attribute>
508
+ <svrl:text>
509
+ [BR-07]-An Invoice shall contain the Buyer name (BT-44).</svrl:text>
510
+ </svrl:failed-assert>
511
+ </xsl:otherwise>
512
+ </xsl:choose>
513
+
514
+ <!--ASSERT -->
515
+ <xsl:choose>
516
+ <xsl:when test="//ram:SellerTradeParty/ram:PostalTradeAddress" />
517
+ <xsl:otherwise>
518
+ <svrl:failed-assert test="//ram:SellerTradeParty/ram:PostalTradeAddress">
519
+ <xsl:attribute name="id">BR-08</xsl:attribute>
520
+ <xsl:attribute name="location">
521
+ <xsl:apply-templates mode="schematron-select-full-path" select="." />
522
+ </xsl:attribute>
523
+ <svrl:text>
524
+ [BR-08]-An Invoice shall contain the Seller postal address (BG-5).</svrl:text>
525
+ </svrl:failed-assert>
526
+ </xsl:otherwise>
527
+ </xsl:choose>
528
+
529
+ <!--ASSERT -->
530
+ <xsl:choose>
531
+ <xsl:when test="//ram:SellerTradeParty/ram:PostalTradeAddress/ram:CountryID!=''" />
532
+ <xsl:otherwise>
533
+ <svrl:failed-assert test="//ram:SellerTradeParty/ram:PostalTradeAddress/ram:CountryID!=''">
534
+ <xsl:attribute name="id">BR-09</xsl:attribute>
535
+ <xsl:attribute name="location">
536
+ <xsl:apply-templates mode="schematron-select-full-path" select="." />
537
+ </xsl:attribute>
538
+ <svrl:text>
539
+ [BR-09]-The Seller postal address (BG-5) shall contain a Seller country code (BT-40).</svrl:text>
540
+ </svrl:failed-assert>
541
+ </xsl:otherwise>
542
+ </xsl:choose>
543
+ <xsl:apply-templates mode="M8" select="@*|*" />
544
+ </xsl:template>
545
+ <xsl:template match="text()" mode="M8" priority="-1" />
546
+ <xsl:template match="@*|node()" mode="M8" priority="-2">
547
+ <xsl:apply-templates mode="M8" select="@*|*" />
548
+ </xsl:template>
549
+
550
+ <!--PATTERN -->
551
+
552
+
553
+ <!--RULE -->
554
+ <xsl:template match="/rsm:CrossIndustryInvoice/rsm:ExchangedDocument" mode="M9" priority="1034">
555
+ <svrl:fired-rule context="/rsm:CrossIndustryInvoice/rsm:ExchangedDocument" />
556
+
557
+ <!--ASSERT -->
558
+ <xsl:choose>
559
+ <xsl:when test="count(ram:ID)=1" />
560
+ <xsl:otherwise>
561
+ <svrl:failed-assert test="count(ram:ID)=1">
562
+ <xsl:attribute name="id">FX-SCH-A-000019</xsl:attribute>
563
+ <xsl:attribute name="location">
564
+ <xsl:apply-templates mode="schematron-select-full-path" select="." />
565
+ </xsl:attribute>
566
+ <svrl:text>
567
+ Element 'ram:ID' must occur exactly 1 times.</svrl:text>
568
+ </svrl:failed-assert>
569
+ </xsl:otherwise>
570
+ </xsl:choose>
571
+
572
+ <!--ASSERT -->
573
+ <xsl:choose>
574
+ <xsl:when test="count(ram:TypeCode)=1" />
575
+ <xsl:otherwise>
576
+ <svrl:failed-assert test="count(ram:TypeCode)=1">
577
+ <xsl:attribute name="id">FX-SCH-A-000020</xsl:attribute>
578
+ <xsl:attribute name="location">
579
+ <xsl:apply-templates mode="schematron-select-full-path" select="." />
580
+ </xsl:attribute>
581
+ <svrl:text>
582
+ Element 'ram:TypeCode' must occur exactly 1 times.</svrl:text>
583
+ </svrl:failed-assert>
584
+ </xsl:otherwise>
585
+ </xsl:choose>
586
+ <xsl:apply-templates mode="M9" select="@*|*" />
587
+ </xsl:template>
588
+
589
+ <!--RULE -->
590
+ <xsl:template match="/rsm:CrossIndustryInvoice/rsm:ExchangedDocument/ram:ID" mode="M9" priority="1033">
591
+ <svrl:fired-rule context="/rsm:CrossIndustryInvoice/rsm:ExchangedDocument/ram:ID" />
592
+
593
+ <!--REPORT -->
594
+ <xsl:if test="@schemeID">
595
+ <svrl:successful-report test="@schemeID">
596
+ <xsl:attribute name="location">
597
+ <xsl:apply-templates mode="schematron-select-full-path" select="." />
598
+ </xsl:attribute>
599
+ <svrl:text>
600
+ Attribute @schemeID' marked as not used in the given context.</svrl:text>
601
+ </svrl:successful-report>
602
+ </xsl:if>
603
+ <xsl:apply-templates mode="M9" select="@*|*" />
604
+ </xsl:template>
605
+
606
+ <!--RULE -->
607
+ <xsl:template match="/rsm:CrossIndustryInvoice/rsm:ExchangedDocument/ram:IssueDateTime/udt:DateTimeString" mode="M9" priority="1032">
608
+ <svrl:fired-rule context="/rsm:CrossIndustryInvoice/rsm:ExchangedDocument/ram:IssueDateTime/udt:DateTimeString" />
609
+
610
+ <!--ASSERT -->
611
+ <xsl:choose>
612
+ <xsl:when test="@format" />
613
+ <xsl:otherwise>
614
+ <svrl:failed-assert test="@format">
615
+ <xsl:attribute name="id">FX-SCH-A-000021</xsl:attribute>
616
+ <xsl:attribute name="location">
617
+ <xsl:apply-templates mode="schematron-select-full-path" select="." />
618
+ </xsl:attribute>
619
+ <svrl:text>
620
+ Attribute '@format' is required in this context.</svrl:text>
621
+ </svrl:failed-assert>
622
+ </xsl:otherwise>
623
+ </xsl:choose>
624
+ <xsl:variable name="codeValue3" select="@format" />
625
+
626
+ <!--ASSERT -->
627
+ <xsl:choose>
628
+ <xsl:when test="string-length($codeValue3)=0 or document('FACTUR-X_MINIMUM_codedb.xml')/codedb/cl[@id=3]/enumeration[@value=$codeValue3]" />
629
+ <xsl:otherwise>
630
+ <svrl:failed-assert test="string-length($codeValue3)=0 or document('FACTUR-X_MINIMUM_codedb.xml')/codedb/cl[@id=3]/enumeration[@value=$codeValue3]">
631
+ <xsl:attribute name="id">FX-SCH-A-000022</xsl:attribute>
632
+ <xsl:attribute name="location">
633
+ <xsl:apply-templates mode="schematron-select-full-path" select="." />
634
+ </xsl:attribute>
635
+ <svrl:text>
636
+ Value of '@format' is not allowed.</svrl:text>
637
+ </svrl:failed-assert>
638
+ </xsl:otherwise>
639
+ </xsl:choose>
640
+ <xsl:apply-templates mode="M9" select="@*|*" />
641
+ </xsl:template>
642
+
643
+ <!--RULE -->
644
+ <xsl:template match="/rsm:CrossIndustryInvoice/rsm:ExchangedDocument/ram:TypeCode" mode="M9" priority="1031">
645
+ <svrl:fired-rule context="/rsm:CrossIndustryInvoice/rsm:ExchangedDocument/ram:TypeCode" />
646
+ <xsl:variable name="codeValue2" select="." />
647
+
648
+ <!--ASSERT -->
649
+ <xsl:choose>
650
+ <xsl:when test="string-length($codeValue2)=0 or document('FACTUR-X_MINIMUM_codedb.xml')/codedb/cl[@id=2]/enumeration[@value=$codeValue2]" />
651
+ <xsl:otherwise>
652
+ <svrl:failed-assert test="string-length($codeValue2)=0 or document('FACTUR-X_MINIMUM_codedb.xml')/codedb/cl[@id=2]/enumeration[@value=$codeValue2]">
653
+ <xsl:attribute name="id">FX-SCH-A-000023</xsl:attribute>
654
+ <xsl:attribute name="location">
655
+ <xsl:apply-templates mode="schematron-select-full-path" select="." />
656
+ </xsl:attribute>
657
+ <svrl:text>
658
+ Value of 'ram:TypeCode' is not allowed.</svrl:text>
659
+ </svrl:failed-assert>
660
+ </xsl:otherwise>
661
+ </xsl:choose>
662
+ <xsl:apply-templates mode="M9" select="@*|*" />
663
+ </xsl:template>
664
+
665
+ <!--RULE -->
666
+ <xsl:template match="/rsm:CrossIndustryInvoice/rsm:ExchangedDocumentContext" mode="M9" priority="1030">
667
+ <svrl:fired-rule context="/rsm:CrossIndustryInvoice/rsm:ExchangedDocumentContext" />
668
+
669
+ <!--ASSERT -->
670
+ <xsl:choose>
671
+ <xsl:when test="count(ram:BusinessProcessSpecifiedDocumentContextParameter)&lt;=1" />
672
+ <xsl:otherwise>
673
+ <svrl:failed-assert test="count(ram:BusinessProcessSpecifiedDocumentContextParameter)&lt;=1">
674
+ <xsl:attribute name="id">FX-SCH-A-000024</xsl:attribute>
675
+ <xsl:attribute name="location">
676
+ <xsl:apply-templates mode="schematron-select-full-path" select="." />
677
+ </xsl:attribute>
678
+ <svrl:text>
679
+ Element 'ram:BusinessProcessSpecifiedDocumentContextParameter' may occur at maximum 1 times.</svrl:text>
680
+ </svrl:failed-assert>
681
+ </xsl:otherwise>
682
+ </xsl:choose>
683
+
684
+ <!--ASSERT -->
685
+ <xsl:choose>
686
+ <xsl:when test="count(ram:GuidelineSpecifiedDocumentContextParameter)=1" />
687
+ <xsl:otherwise>
688
+ <svrl:failed-assert test="count(ram:GuidelineSpecifiedDocumentContextParameter)=1">
689
+ <xsl:attribute name="id">FX-SCH-A-000025</xsl:attribute>
690
+ <xsl:attribute name="location">
691
+ <xsl:apply-templates mode="schematron-select-full-path" select="." />
692
+ </xsl:attribute>
693
+ <svrl:text>
694
+ Element 'ram:GuidelineSpecifiedDocumentContextParameter' must occur exactly 1 times.</svrl:text>
695
+ </svrl:failed-assert>
696
+ </xsl:otherwise>
697
+ </xsl:choose>
698
+ <xsl:apply-templates mode="M9" select="@*|*" />
699
+ </xsl:template>
700
+
701
+ <!--RULE -->
702
+ <xsl:template match="/rsm:CrossIndustryInvoice/rsm:ExchangedDocumentContext/ram:BusinessProcessSpecifiedDocumentContextParameter" mode="M9" priority="1029">
703
+ <svrl:fired-rule context="/rsm:CrossIndustryInvoice/rsm:ExchangedDocumentContext/ram:BusinessProcessSpecifiedDocumentContextParameter" />
704
+
705
+ <!--ASSERT -->
706
+ <xsl:choose>
707
+ <xsl:when test="count(ram:ID)=1" />
708
+ <xsl:otherwise>
709
+ <svrl:failed-assert test="count(ram:ID)=1">
710
+ <xsl:attribute name="id">FX-SCH-A-000406</xsl:attribute>
711
+ <xsl:attribute name="location">
712
+ <xsl:apply-templates mode="schematron-select-full-path" select="." />
713
+ </xsl:attribute>
714
+ <svrl:text>
715
+ Element 'ram:ID' must occur exactly 1 times.</svrl:text>
716
+ </svrl:failed-assert>
717
+ </xsl:otherwise>
718
+ </xsl:choose>
719
+ <xsl:apply-templates mode="M9" select="@*|*" />
720
+ </xsl:template>
721
+
722
+ <!--RULE -->
723
+ <xsl:template match="/rsm:CrossIndustryInvoice/rsm:ExchangedDocumentContext/ram:BusinessProcessSpecifiedDocumentContextParameter/ram:ID" mode="M9" priority="1028">
724
+ <svrl:fired-rule context="/rsm:CrossIndustryInvoice/rsm:ExchangedDocumentContext/ram:BusinessProcessSpecifiedDocumentContextParameter/ram:ID" />
725
+
726
+ <!--REPORT -->
727
+ <xsl:if test="@schemeID">
728
+ <svrl:successful-report test="@schemeID">
729
+ <xsl:attribute name="location">
730
+ <xsl:apply-templates mode="schematron-select-full-path" select="." />
731
+ </xsl:attribute>
732
+ <svrl:text>
733
+ Attribute @schemeID' marked as not used in the given context.</svrl:text>
734
+ </svrl:successful-report>
735
+ </xsl:if>
736
+ <xsl:apply-templates mode="M9" select="@*|*" />
737
+ </xsl:template>
738
+
739
+ <!--RULE -->
740
+ <xsl:template match="/rsm:CrossIndustryInvoice/rsm:ExchangedDocumentContext/ram:GuidelineSpecifiedDocumentContextParameter" mode="M9" priority="1027">
741
+ <svrl:fired-rule context="/rsm:CrossIndustryInvoice/rsm:ExchangedDocumentContext/ram:GuidelineSpecifiedDocumentContextParameter" />
742
+
743
+ <!--ASSERT -->
744
+ <xsl:choose>
745
+ <xsl:when test="count(ram:ID)=1" />
746
+ <xsl:otherwise>
747
+ <svrl:failed-assert test="count(ram:ID)=1">
748
+ <xsl:attribute name="id">FX-SCH-A-000407</xsl:attribute>
749
+ <xsl:attribute name="location">
750
+ <xsl:apply-templates mode="schematron-select-full-path" select="." />
751
+ </xsl:attribute>
752
+ <svrl:text>
753
+ Element 'ram:ID' must occur exactly 1 times.</svrl:text>
754
+ </svrl:failed-assert>
755
+ </xsl:otherwise>
756
+ </xsl:choose>
757
+ <xsl:apply-templates mode="M9" select="@*|*" />
758
+ </xsl:template>
759
+
760
+ <!--RULE -->
761
+ <xsl:template match="/rsm:CrossIndustryInvoice/rsm:ExchangedDocumentContext/ram:GuidelineSpecifiedDocumentContextParameter/ram:ID" mode="M9" priority="1026">
762
+ <svrl:fired-rule context="/rsm:CrossIndustryInvoice/rsm:ExchangedDocumentContext/ram:GuidelineSpecifiedDocumentContextParameter/ram:ID" />
763
+ <xsl:variable name="codeValue1" select="." />
764
+
765
+ <!--ASSERT -->
766
+ <xsl:choose>
767
+ <xsl:when test="string-length($codeValue1)=0 or document('FACTUR-X_MINIMUM_codedb.xml')/codedb/cl[@id=1]/enumeration[@value=$codeValue1]" />
768
+ <xsl:otherwise>
769
+ <svrl:failed-assert test="string-length($codeValue1)=0 or document('FACTUR-X_MINIMUM_codedb.xml')/codedb/cl[@id=1]/enumeration[@value=$codeValue1]">
770
+ <xsl:attribute name="id">FX-SCH-A-000026</xsl:attribute>
771
+ <xsl:attribute name="location">
772
+ <xsl:apply-templates mode="schematron-select-full-path" select="." />
773
+ </xsl:attribute>
774
+ <svrl:text>
775
+ Value of 'ram:ID' is not allowed.</svrl:text>
776
+ </svrl:failed-assert>
777
+ </xsl:otherwise>
778
+ </xsl:choose>
779
+
780
+ <!--REPORT -->
781
+ <xsl:if test="@schemeID">
782
+ <svrl:successful-report test="@schemeID">
783
+ <xsl:attribute name="location">
784
+ <xsl:apply-templates mode="schematron-select-full-path" select="." />
785
+ </xsl:attribute>
786
+ <svrl:text>
787
+ Attribute @schemeID' marked as not used in the given context.</svrl:text>
788
+ </svrl:successful-report>
789
+ </xsl:if>
790
+ <xsl:apply-templates mode="M9" select="@*|*" />
791
+ </xsl:template>
792
+
793
+ <!--RULE -->
794
+ <xsl:template match="/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement" mode="M9" priority="1025">
795
+ <svrl:fired-rule context="/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement" />
796
+
797
+ <!--ASSERT -->
798
+ <xsl:choose>
799
+ <xsl:when test="count(ram:SellerTradeParty)=1" />
800
+ <xsl:otherwise>
801
+ <svrl:failed-assert test="count(ram:SellerTradeParty)=1">
802
+ <xsl:attribute name="id">FX-SCH-A-000027</xsl:attribute>
803
+ <xsl:attribute name="location">
804
+ <xsl:apply-templates mode="schematron-select-full-path" select="." />
805
+ </xsl:attribute>
806
+ <svrl:text>
807
+ Element 'ram:SellerTradeParty' must occur exactly 1 times.</svrl:text>
808
+ </svrl:failed-assert>
809
+ </xsl:otherwise>
810
+ </xsl:choose>
811
+
812
+ <!--ASSERT -->
813
+ <xsl:choose>
814
+ <xsl:when test="count(ram:BuyerTradeParty)=1" />
815
+ <xsl:otherwise>
816
+ <svrl:failed-assert test="count(ram:BuyerTradeParty)=1">
817
+ <xsl:attribute name="id">FX-SCH-A-000028</xsl:attribute>
818
+ <xsl:attribute name="location">
819
+ <xsl:apply-templates mode="schematron-select-full-path" select="." />
820
+ </xsl:attribute>
821
+ <svrl:text>
822
+ Element 'ram:BuyerTradeParty' must occur exactly 1 times.</svrl:text>
823
+ </svrl:failed-assert>
824
+ </xsl:otherwise>
825
+ </xsl:choose>
826
+ <xsl:apply-templates mode="M9" select="@*|*" />
827
+ </xsl:template>
828
+
829
+ <!--RULE -->
830
+ <xsl:template match="/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:BuyerOrderReferencedDocument" mode="M9" priority="1024">
831
+ <svrl:fired-rule context="/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:BuyerOrderReferencedDocument" />
832
+
833
+ <!--ASSERT -->
834
+ <xsl:choose>
835
+ <xsl:when test="count(ram:IssuerAssignedID)=1" />
836
+ <xsl:otherwise>
837
+ <svrl:failed-assert test="count(ram:IssuerAssignedID)=1">
838
+ <xsl:attribute name="id">FX-SCH-A-000029</xsl:attribute>
839
+ <xsl:attribute name="location">
840
+ <xsl:apply-templates mode="schematron-select-full-path" select="." />
841
+ </xsl:attribute>
842
+ <svrl:text>
843
+ Element 'ram:IssuerAssignedID' must occur exactly 1 times.</svrl:text>
844
+ </svrl:failed-assert>
845
+ </xsl:otherwise>
846
+ </xsl:choose>
847
+ <xsl:apply-templates mode="M9" select="@*|*" />
848
+ </xsl:template>
849
+
850
+ <!--RULE -->
851
+ <xsl:template match="/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:BuyerOrderReferencedDocument/ram:IssuerAssignedID" mode="M9" priority="1023">
852
+ <svrl:fired-rule context="/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:BuyerOrderReferencedDocument/ram:IssuerAssignedID" />
853
+
854
+ <!--REPORT -->
855
+ <xsl:if test="@schemeID">
856
+ <svrl:successful-report test="@schemeID">
857
+ <xsl:attribute name="location">
858
+ <xsl:apply-templates mode="schematron-select-full-path" select="." />
859
+ </xsl:attribute>
860
+ <svrl:text>
861
+ Attribute @schemeID' marked as not used in the given context.</svrl:text>
862
+ </svrl:successful-report>
863
+ </xsl:if>
864
+ <xsl:apply-templates mode="M9" select="@*|*" />
865
+ </xsl:template>
866
+
867
+ <!--RULE -->
868
+ <xsl:template match="/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:BuyerTradeParty" mode="M9" priority="1022">
869
+ <svrl:fired-rule context="/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:BuyerTradeParty" />
870
+
871
+ <!--ASSERT -->
872
+ <xsl:choose>
873
+ <xsl:when test="count(ram:Name)=1" />
874
+ <xsl:otherwise>
875
+ <svrl:failed-assert test="count(ram:Name)=1">
876
+ <xsl:attribute name="id">FX-SCH-A-000030</xsl:attribute>
877
+ <xsl:attribute name="location">
878
+ <xsl:apply-templates mode="schematron-select-full-path" select="." />
879
+ </xsl:attribute>
880
+ <svrl:text>
881
+ Element 'ram:Name' must occur exactly 1 times.</svrl:text>
882
+ </svrl:failed-assert>
883
+ </xsl:otherwise>
884
+ </xsl:choose>
885
+ <xsl:apply-templates mode="M9" select="@*|*" />
886
+ </xsl:template>
887
+
888
+ <!--RULE -->
889
+ <xsl:template match="/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:BuyerTradeParty/ram:PostalTradeAddress" mode="M9" priority="1021">
890
+ <svrl:fired-rule context="/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:BuyerTradeParty/ram:PostalTradeAddress" />
891
+
892
+ <!--REPORT -->
893
+ <xsl:if test="true()">
894
+ <svrl:successful-report test="true()">
895
+ <xsl:attribute name="location">
896
+ <xsl:apply-templates mode="schematron-select-full-path" select="." />
897
+ </xsl:attribute>
898
+ <svrl:text>
899
+ Element 'ram:PostalTradeAddress' is marked as not used in the given context.</svrl:text>
900
+ </svrl:successful-report>
901
+ </xsl:if>
902
+ <xsl:apply-templates mode="M9" select="@*|*" />
903
+ </xsl:template>
904
+
905
+ <!--RULE -->
906
+ <xsl:template match="/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:BuyerTradeParty/ram:SpecifiedLegalOrganization" mode="M9" priority="1020">
907
+ <svrl:fired-rule context="/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:BuyerTradeParty/ram:SpecifiedLegalOrganization" />
908
+
909
+ <!--ASSERT -->
910
+ <xsl:choose>
911
+ <xsl:when test="count(ram:ID)=1" />
912
+ <xsl:otherwise>
913
+ <svrl:failed-assert test="count(ram:ID)=1">
914
+ <xsl:attribute name="id">FX-SCH-A-000408</xsl:attribute>
915
+ <xsl:attribute name="location">
916
+ <xsl:apply-templates mode="schematron-select-full-path" select="." />
917
+ </xsl:attribute>
918
+ <svrl:text>
919
+ Element 'ram:ID' must occur exactly 1 times.</svrl:text>
920
+ </svrl:failed-assert>
921
+ </xsl:otherwise>
922
+ </xsl:choose>
923
+ <xsl:apply-templates mode="M9" select="@*|*" />
924
+ </xsl:template>
925
+
926
+ <!--RULE -->
927
+ <xsl:template match="/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:BuyerTradeParty/ram:SpecifiedLegalOrganization/ram:ID" mode="M9" priority="1019">
928
+ <svrl:fired-rule context="/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:BuyerTradeParty/ram:SpecifiedLegalOrganization/ram:ID" />
929
+ <xsl:variable name="codeValue4" select="@schemeID" />
930
+
931
+ <!--ASSERT -->
932
+ <xsl:choose>
933
+ <xsl:when test="string-length($codeValue4)=0 or document('FACTUR-X_MINIMUM_codedb.xml')/codedb/cl[@id=4]/enumeration[@value=$codeValue4]" />
934
+ <xsl:otherwise>
935
+ <svrl:failed-assert test="string-length($codeValue4)=0 or document('FACTUR-X_MINIMUM_codedb.xml')/codedb/cl[@id=4]/enumeration[@value=$codeValue4]">
936
+ <xsl:attribute name="id">FX-SCH-A-000031</xsl:attribute>
937
+ <xsl:attribute name="location">
938
+ <xsl:apply-templates mode="schematron-select-full-path" select="." />
939
+ </xsl:attribute>
940
+ <svrl:text>
941
+ Value of '@schemeID' is not allowed.</svrl:text>
942
+ </svrl:failed-assert>
943
+ </xsl:otherwise>
944
+ </xsl:choose>
945
+ <xsl:apply-templates mode="M9" select="@*|*" />
946
+ </xsl:template>
947
+
948
+ <!--RULE -->
949
+ <xsl:template match="/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:BuyerTradeParty/ram:SpecifiedTaxRegistration" mode="M9" priority="1018">
950
+ <svrl:fired-rule context="/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:BuyerTradeParty/ram:SpecifiedTaxRegistration" />
951
+
952
+ <!--REPORT -->
953
+ <xsl:if test="true()">
954
+ <svrl:successful-report test="true()">
955
+ <xsl:attribute name="location">
956
+ <xsl:apply-templates mode="schematron-select-full-path" select="." />
957
+ </xsl:attribute>
958
+ <svrl:text>
959
+ Element 'ram:SpecifiedTaxRegistration' is marked as not used in the given context.</svrl:text>
960
+ </svrl:successful-report>
961
+ </xsl:if>
962
+ <xsl:apply-templates mode="M9" select="@*|*" />
963
+ </xsl:template>
964
+
965
+ <!--RULE -->
966
+ <xsl:template match="/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:SellerTradeParty" mode="M9" priority="1017">
967
+ <svrl:fired-rule context="/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:SellerTradeParty" />
968
+
969
+ <!--ASSERT -->
970
+ <xsl:choose>
971
+ <xsl:when test="count(ram:Name)=1" />
972
+ <xsl:otherwise>
973
+ <svrl:failed-assert test="count(ram:Name)=1">
974
+ <xsl:attribute name="id">FX-SCH-A-000409</xsl:attribute>
975
+ <xsl:attribute name="location">
976
+ <xsl:apply-templates mode="schematron-select-full-path" select="." />
977
+ </xsl:attribute>
978
+ <svrl:text>
979
+ Element 'ram:Name' must occur exactly 1 times.</svrl:text>
980
+ </svrl:failed-assert>
981
+ </xsl:otherwise>
982
+ </xsl:choose>
983
+
984
+ <!--ASSERT -->
985
+ <xsl:choose>
986
+ <xsl:when test="count(ram:PostalTradeAddress)=1" />
987
+ <xsl:otherwise>
988
+ <svrl:failed-assert test="count(ram:PostalTradeAddress)=1">
989
+ <xsl:attribute name="id">FX-SCH-A-000032</xsl:attribute>
990
+ <xsl:attribute name="location">
991
+ <xsl:apply-templates mode="schematron-select-full-path" select="." />
992
+ </xsl:attribute>
993
+ <svrl:text>
994
+ Element 'ram:PostalTradeAddress' must occur exactly 1 times.</svrl:text>
995
+ </svrl:failed-assert>
996
+ </xsl:otherwise>
997
+ </xsl:choose>
998
+
999
+ <!--ASSERT -->
1000
+ <xsl:choose>
1001
+ <xsl:when test="count(ram:SpecifiedTaxRegistration[ram:ID/@schemeID=&quot;VA&quot;])&lt;=1" />
1002
+ <xsl:otherwise>
1003
+ <svrl:failed-assert test="count(ram:SpecifiedTaxRegistration[ram:ID/@schemeID=&quot;VA&quot;])&lt;=1">
1004
+ <xsl:attribute name="id">FX-SCH-A-000033</xsl:attribute>
1005
+ <xsl:attribute name="location">
1006
+ <xsl:apply-templates mode="schematron-select-full-path" select="." />
1007
+ </xsl:attribute>
1008
+ <svrl:text>
1009
+ Element variant 'ram:SpecifiedTaxRegistration[ram:ID/@schemeID="VA"]' may occur at maximum 1 times.</svrl:text>
1010
+ </svrl:failed-assert>
1011
+ </xsl:otherwise>
1012
+ </xsl:choose>
1013
+
1014
+ <!--ASSERT -->
1015
+ <xsl:choose>
1016
+ <xsl:when test="count(ram:SpecifiedTaxRegistration[ram:ID/@schemeID=&quot;FC&quot;])&lt;=1" />
1017
+ <xsl:otherwise>
1018
+ <svrl:failed-assert test="count(ram:SpecifiedTaxRegistration[ram:ID/@schemeID=&quot;FC&quot;])&lt;=1">
1019
+ <xsl:attribute name="id">FX-SCH-A-000034</xsl:attribute>
1020
+ <xsl:attribute name="location">
1021
+ <xsl:apply-templates mode="schematron-select-full-path" select="." />
1022
+ </xsl:attribute>
1023
+ <svrl:text>
1024
+ Element variant 'ram:SpecifiedTaxRegistration[ram:ID/@schemeID="FC"]' may occur at maximum 1 times.</svrl:text>
1025
+ </svrl:failed-assert>
1026
+ </xsl:otherwise>
1027
+ </xsl:choose>
1028
+ <xsl:apply-templates mode="M9" select="@*|*" />
1029
+ </xsl:template>
1030
+
1031
+ <!--RULE -->
1032
+ <xsl:template match="/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:SellerTradeParty/ram:PostalTradeAddress" mode="M9" priority="1016">
1033
+ <svrl:fired-rule context="/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:SellerTradeParty/ram:PostalTradeAddress" />
1034
+
1035
+ <!--ASSERT -->
1036
+ <xsl:choose>
1037
+ <xsl:when test="count(ram:CountryID)=1" />
1038
+ <xsl:otherwise>
1039
+ <svrl:failed-assert test="count(ram:CountryID)=1">
1040
+ <xsl:attribute name="id">FX-SCH-A-000035</xsl:attribute>
1041
+ <xsl:attribute name="location">
1042
+ <xsl:apply-templates mode="schematron-select-full-path" select="." />
1043
+ </xsl:attribute>
1044
+ <svrl:text>
1045
+ Element 'ram:CountryID' must occur exactly 1 times.</svrl:text>
1046
+ </svrl:failed-assert>
1047
+ </xsl:otherwise>
1048
+ </xsl:choose>
1049
+ <xsl:apply-templates mode="M9" select="@*|*" />
1050
+ </xsl:template>
1051
+
1052
+ <!--RULE -->
1053
+ <xsl:template match="/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:SellerTradeParty/ram:PostalTradeAddress/ram:CountryID" mode="M9" priority="1015">
1054
+ <svrl:fired-rule context="/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:SellerTradeParty/ram:PostalTradeAddress/ram:CountryID" />
1055
+ <xsl:variable name="codeValue5" select="." />
1056
+
1057
+ <!--ASSERT -->
1058
+ <xsl:choose>
1059
+ <xsl:when test="string-length($codeValue5)=0 or document('FACTUR-X_MINIMUM_codedb.xml')/codedb/cl[@id=5]/enumeration[@value=$codeValue5]" />
1060
+ <xsl:otherwise>
1061
+ <svrl:failed-assert test="string-length($codeValue5)=0 or document('FACTUR-X_MINIMUM_codedb.xml')/codedb/cl[@id=5]/enumeration[@value=$codeValue5]">
1062
+ <xsl:attribute name="id">FX-SCH-A-000036</xsl:attribute>
1063
+ <xsl:attribute name="location">
1064
+ <xsl:apply-templates mode="schematron-select-full-path" select="." />
1065
+ </xsl:attribute>
1066
+ <svrl:text>
1067
+ Value of 'ram:CountryID' is not allowed.</svrl:text>
1068
+ </svrl:failed-assert>
1069
+ </xsl:otherwise>
1070
+ </xsl:choose>
1071
+ <xsl:apply-templates mode="M9" select="@*|*" />
1072
+ </xsl:template>
1073
+
1074
+ <!--RULE -->
1075
+ <xsl:template match="/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:SellerTradeParty/ram:SpecifiedLegalOrganization/ram:ID" mode="M9" priority="1014">
1076
+ <svrl:fired-rule context="/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:SellerTradeParty/ram:SpecifiedLegalOrganization/ram:ID" />
1077
+ <xsl:variable name="codeValue4" select="@schemeID" />
1078
+
1079
+ <!--ASSERT -->
1080
+ <xsl:choose>
1081
+ <xsl:when test="string-length($codeValue4)=0 or document('FACTUR-X_MINIMUM_codedb.xml')/codedb/cl[@id=4]/enumeration[@value=$codeValue4]" />
1082
+ <xsl:otherwise>
1083
+ <svrl:failed-assert test="string-length($codeValue4)=0 or document('FACTUR-X_MINIMUM_codedb.xml')/codedb/cl[@id=4]/enumeration[@value=$codeValue4]">
1084
+ <xsl:attribute name="id">FX-SCH-A-000410</xsl:attribute>
1085
+ <xsl:attribute name="location">
1086
+ <xsl:apply-templates mode="schematron-select-full-path" select="." />
1087
+ </xsl:attribute>
1088
+ <svrl:text>
1089
+ Value of '@schemeID' is not allowed.</svrl:text>
1090
+ </svrl:failed-assert>
1091
+ </xsl:otherwise>
1092
+ </xsl:choose>
1093
+ <xsl:apply-templates mode="M9" select="@*|*" />
1094
+ </xsl:template>
1095
+
1096
+ <!--RULE -->
1097
+ <xsl:template match="/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:SellerTradeParty/ram:SpecifiedTaxRegistration[ not(ram:ID/@schemeID=&quot;VA&quot;) and not(ram:ID/@schemeID=&quot;FC&quot;)]" mode="M9" priority="1013">
1098
+ <svrl:fired-rule context="/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:SellerTradeParty/ram:SpecifiedTaxRegistration[ not(ram:ID/@schemeID=&quot;VA&quot;) and not(ram:ID/@schemeID=&quot;FC&quot;)]" />
1099
+
1100
+ <!--REPORT -->
1101
+ <xsl:if test="true()">
1102
+ <svrl:successful-report test="true()">
1103
+ <xsl:attribute name="location">
1104
+ <xsl:apply-templates mode="schematron-select-full-path" select="." />
1105
+ </xsl:attribute>
1106
+ <svrl:text>
1107
+ Element variant 'ram:SpecifiedTaxRegistration[ not(ram:ID/@schemeID="VA") and not(ram:ID/@schemeID="FC")]' is marked as not used in the given context.</svrl:text>
1108
+ </svrl:successful-report>
1109
+ </xsl:if>
1110
+ <xsl:apply-templates mode="M9" select="@*|*" />
1111
+ </xsl:template>
1112
+
1113
+ <!--RULE -->
1114
+ <xsl:template match="/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:SellerTradeParty/ram:SpecifiedTaxRegistration[ram:ID/@schemeID=&quot;FC&quot;]" mode="M9" priority="1012">
1115
+ <svrl:fired-rule context="/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:SellerTradeParty/ram:SpecifiedTaxRegistration[ram:ID/@schemeID=&quot;FC&quot;]" />
1116
+
1117
+ <!--ASSERT -->
1118
+ <xsl:choose>
1119
+ <xsl:when test="count(ram:ID)=1" />
1120
+ <xsl:otherwise>
1121
+ <svrl:failed-assert test="count(ram:ID)=1">
1122
+ <xsl:attribute name="id">FX-SCH-A-000411</xsl:attribute>
1123
+ <xsl:attribute name="location">
1124
+ <xsl:apply-templates mode="schematron-select-full-path" select="." />
1125
+ </xsl:attribute>
1126
+ <svrl:text>
1127
+ Element 'ram:ID' must occur exactly 1 times.</svrl:text>
1128
+ </svrl:failed-assert>
1129
+ </xsl:otherwise>
1130
+ </xsl:choose>
1131
+ <xsl:apply-templates mode="M9" select="@*|*" />
1132
+ </xsl:template>
1133
+
1134
+ <!--RULE -->
1135
+ <xsl:template match="/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:SellerTradeParty/ram:SpecifiedTaxRegistration[ram:ID/@schemeID=&quot;FC&quot;]/ram:ID" mode="M9" priority="1011">
1136
+ <svrl:fired-rule context="/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:SellerTradeParty/ram:SpecifiedTaxRegistration[ram:ID/@schemeID=&quot;FC&quot;]/ram:ID" />
1137
+
1138
+ <!--ASSERT -->
1139
+ <xsl:choose>
1140
+ <xsl:when test="@schemeID" />
1141
+ <xsl:otherwise>
1142
+ <svrl:failed-assert test="@schemeID">
1143
+ <xsl:attribute name="id">FX-SCH-A-000037</xsl:attribute>
1144
+ <xsl:attribute name="location">
1145
+ <xsl:apply-templates mode="schematron-select-full-path" select="." />
1146
+ </xsl:attribute>
1147
+ <svrl:text>
1148
+ Attribute '@schemeID' is required in this context.</svrl:text>
1149
+ </svrl:failed-assert>
1150
+ </xsl:otherwise>
1151
+ </xsl:choose>
1152
+ <xsl:apply-templates mode="M9" select="@*|*" />
1153
+ </xsl:template>
1154
+
1155
+ <!--RULE -->
1156
+ <xsl:template match="/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:SellerTradeParty/ram:SpecifiedTaxRegistration[ram:ID/@schemeID=&quot;VA&quot;]" mode="M9" priority="1010">
1157
+ <svrl:fired-rule context="/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:SellerTradeParty/ram:SpecifiedTaxRegistration[ram:ID/@schemeID=&quot;VA&quot;]" />
1158
+
1159
+ <!--ASSERT -->
1160
+ <xsl:choose>
1161
+ <xsl:when test="count(ram:ID)=1" />
1162
+ <xsl:otherwise>
1163
+ <svrl:failed-assert test="count(ram:ID)=1">
1164
+ <xsl:attribute name="id">FX-SCH-A-000412</xsl:attribute>
1165
+ <xsl:attribute name="location">
1166
+ <xsl:apply-templates mode="schematron-select-full-path" select="." />
1167
+ </xsl:attribute>
1168
+ <svrl:text>
1169
+ Element 'ram:ID' must occur exactly 1 times.</svrl:text>
1170
+ </svrl:failed-assert>
1171
+ </xsl:otherwise>
1172
+ </xsl:choose>
1173
+ <xsl:apply-templates mode="M9" select="@*|*" />
1174
+ </xsl:template>
1175
+
1176
+ <!--RULE -->
1177
+ <xsl:template match="/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:SellerTradeParty/ram:SpecifiedTaxRegistration[ram:ID/@schemeID=&quot;VA&quot;]/ram:ID" mode="M9" priority="1009">
1178
+ <svrl:fired-rule context="/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:SellerTradeParty/ram:SpecifiedTaxRegistration[ram:ID/@schemeID=&quot;VA&quot;]/ram:ID" />
1179
+
1180
+ <!--ASSERT -->
1181
+ <xsl:choose>
1182
+ <xsl:when test="@schemeID" />
1183
+ <xsl:otherwise>
1184
+ <svrl:failed-assert test="@schemeID">
1185
+ <xsl:attribute name="id">FX-SCH-A-000413</xsl:attribute>
1186
+ <xsl:attribute name="location">
1187
+ <xsl:apply-templates mode="schematron-select-full-path" select="." />
1188
+ </xsl:attribute>
1189
+ <svrl:text>
1190
+ Attribute '@schemeID' is required in this context.</svrl:text>
1191
+ </svrl:failed-assert>
1192
+ </xsl:otherwise>
1193
+ </xsl:choose>
1194
+ <xsl:apply-templates mode="M9" select="@*|*" />
1195
+ </xsl:template>
1196
+
1197
+ <!--RULE -->
1198
+ <xsl:template match="/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement" mode="M9" priority="1008">
1199
+ <svrl:fired-rule context="/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement" />
1200
+
1201
+ <!--ASSERT -->
1202
+ <xsl:choose>
1203
+ <xsl:when test="count(ram:InvoiceCurrencyCode)=1" />
1204
+ <xsl:otherwise>
1205
+ <svrl:failed-assert test="count(ram:InvoiceCurrencyCode)=1">
1206
+ <xsl:attribute name="id">FX-SCH-A-000038</xsl:attribute>
1207
+ <xsl:attribute name="location">
1208
+ <xsl:apply-templates mode="schematron-select-full-path" select="." />
1209
+ </xsl:attribute>
1210
+ <svrl:text>
1211
+ Element 'ram:InvoiceCurrencyCode' must occur exactly 1 times.</svrl:text>
1212
+ </svrl:failed-assert>
1213
+ </xsl:otherwise>
1214
+ </xsl:choose>
1215
+
1216
+ <!--ASSERT -->
1217
+ <xsl:choose>
1218
+ <xsl:when test="count(ram:SpecifiedTradeSettlementHeaderMonetarySummation)=1" />
1219
+ <xsl:otherwise>
1220
+ <svrl:failed-assert test="count(ram:SpecifiedTradeSettlementHeaderMonetarySummation)=1">
1221
+ <xsl:attribute name="id">FX-SCH-A-000039</xsl:attribute>
1222
+ <xsl:attribute name="location">
1223
+ <xsl:apply-templates mode="schematron-select-full-path" select="." />
1224
+ </xsl:attribute>
1225
+ <svrl:text>
1226
+ Element 'ram:SpecifiedTradeSettlementHeaderMonetarySummation' must occur exactly 1 times.</svrl:text>
1227
+ </svrl:failed-assert>
1228
+ </xsl:otherwise>
1229
+ </xsl:choose>
1230
+ <xsl:apply-templates mode="M9" select="@*|*" />
1231
+ </xsl:template>
1232
+
1233
+ <!--RULE -->
1234
+ <xsl:template match="/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:InvoiceCurrencyCode" mode="M9" priority="1007">
1235
+ <svrl:fired-rule context="/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:InvoiceCurrencyCode" />
1236
+ <xsl:variable name="codeValue6" select="." />
1237
+
1238
+ <!--ASSERT -->
1239
+ <xsl:choose>
1240
+ <xsl:when test="string-length($codeValue6)=0 or document('FACTUR-X_MINIMUM_codedb.xml')/codedb/cl[@id=6]/enumeration[@value=$codeValue6]" />
1241
+ <xsl:otherwise>
1242
+ <svrl:failed-assert test="string-length($codeValue6)=0 or document('FACTUR-X_MINIMUM_codedb.xml')/codedb/cl[@id=6]/enumeration[@value=$codeValue6]">
1243
+ <xsl:attribute name="id">FX-SCH-A-000040</xsl:attribute>
1244
+ <xsl:attribute name="location">
1245
+ <xsl:apply-templates mode="schematron-select-full-path" select="." />
1246
+ </xsl:attribute>
1247
+ <svrl:text>
1248
+ Value of 'ram:InvoiceCurrencyCode' is not allowed.</svrl:text>
1249
+ </svrl:failed-assert>
1250
+ </xsl:otherwise>
1251
+ </xsl:choose>
1252
+ <xsl:apply-templates mode="M9" select="@*|*" />
1253
+ </xsl:template>
1254
+
1255
+ <!--RULE -->
1256
+ <xsl:template match="/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:SpecifiedTradeSettlementHeaderMonetarySummation" mode="M9" priority="1006">
1257
+ <svrl:fired-rule context="/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:SpecifiedTradeSettlementHeaderMonetarySummation" />
1258
+
1259
+ <!--ASSERT -->
1260
+ <xsl:choose>
1261
+ <xsl:when test="count(ram:TaxBasisTotalAmount)=1" />
1262
+ <xsl:otherwise>
1263
+ <svrl:failed-assert test="count(ram:TaxBasisTotalAmount)=1">
1264
+ <xsl:attribute name="id">FX-SCH-A-000041</xsl:attribute>
1265
+ <xsl:attribute name="location">
1266
+ <xsl:apply-templates mode="schematron-select-full-path" select="." />
1267
+ </xsl:attribute>
1268
+ <svrl:text>
1269
+ Element 'ram:TaxBasisTotalAmount' must occur exactly 1 times.</svrl:text>
1270
+ </svrl:failed-assert>
1271
+ </xsl:otherwise>
1272
+ </xsl:choose>
1273
+
1274
+ <!--ASSERT -->
1275
+ <xsl:choose>
1276
+ <xsl:when test="count(ram:TaxTotalAmount[@currencyID=../../ram:InvoiceCurrencyCode])&lt;=1" />
1277
+ <xsl:otherwise>
1278
+ <svrl:failed-assert test="count(ram:TaxTotalAmount[@currencyID=../../ram:InvoiceCurrencyCode])&lt;=1">
1279
+ <xsl:attribute name="id">FX-SCH-A-000042</xsl:attribute>
1280
+ <xsl:attribute name="location">
1281
+ <xsl:apply-templates mode="schematron-select-full-path" select="." />
1282
+ </xsl:attribute>
1283
+ <svrl:text>
1284
+ Element variant 'ram:TaxTotalAmount[@currencyID=../../ram:InvoiceCurrencyCode]' may occur at maximum 1 times.</svrl:text>
1285
+ </svrl:failed-assert>
1286
+ </xsl:otherwise>
1287
+ </xsl:choose>
1288
+
1289
+ <!--ASSERT -->
1290
+ <xsl:choose>
1291
+ <xsl:when test="count(ram:TaxTotalAmount[@currencyID=../../ram:TaxCurrencyCode])&lt;=1" />
1292
+ <xsl:otherwise>
1293
+ <svrl:failed-assert test="count(ram:TaxTotalAmount[@currencyID=../../ram:TaxCurrencyCode])&lt;=1">
1294
+ <xsl:attribute name="id">FX-SCH-A-000192</xsl:attribute>
1295
+ <xsl:attribute name="location">
1296
+ <xsl:apply-templates mode="schematron-select-full-path" select="." />
1297
+ </xsl:attribute>
1298
+ <svrl:text>
1299
+ Element variant 'ram:TaxTotalAmount[@currencyID=../../ram:TaxCurrencyCode]' may occur at maximum 1 times.</svrl:text>
1300
+ </svrl:failed-assert>
1301
+ </xsl:otherwise>
1302
+ </xsl:choose>
1303
+
1304
+ <!--ASSERT -->
1305
+ <xsl:choose>
1306
+ <xsl:when test="count(ram:GrandTotalAmount)=1" />
1307
+ <xsl:otherwise>
1308
+ <svrl:failed-assert test="count(ram:GrandTotalAmount)=1">
1309
+ <xsl:attribute name="id">FX-SCH-A-000043</xsl:attribute>
1310
+ <xsl:attribute name="location">
1311
+ <xsl:apply-templates mode="schematron-select-full-path" select="." />
1312
+ </xsl:attribute>
1313
+ <svrl:text>
1314
+ Element 'ram:GrandTotalAmount' must occur exactly 1 times.</svrl:text>
1315
+ </svrl:failed-assert>
1316
+ </xsl:otherwise>
1317
+ </xsl:choose>
1318
+
1319
+ <!--ASSERT -->
1320
+ <xsl:choose>
1321
+ <xsl:when test="count(ram:DuePayableAmount)=1" />
1322
+ <xsl:otherwise>
1323
+ <svrl:failed-assert test="count(ram:DuePayableAmount)=1">
1324
+ <xsl:attribute name="id">FX-SCH-A-000044</xsl:attribute>
1325
+ <xsl:attribute name="location">
1326
+ <xsl:apply-templates mode="schematron-select-full-path" select="." />
1327
+ </xsl:attribute>
1328
+ <svrl:text>
1329
+ Element 'ram:DuePayableAmount' must occur exactly 1 times.</svrl:text>
1330
+ </svrl:failed-assert>
1331
+ </xsl:otherwise>
1332
+ </xsl:choose>
1333
+ <xsl:apply-templates mode="M9" select="@*|*" />
1334
+ </xsl:template>
1335
+
1336
+ <!--RULE -->
1337
+ <xsl:template match="/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:SpecifiedTradeSettlementHeaderMonetarySummation/ram:DuePayableAmount" mode="M9" priority="1005">
1338
+ <svrl:fired-rule context="/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:SpecifiedTradeSettlementHeaderMonetarySummation/ram:DuePayableAmount" />
1339
+
1340
+ <!--REPORT -->
1341
+ <xsl:if test="@currencyID">
1342
+ <svrl:successful-report test="@currencyID">
1343
+ <xsl:attribute name="location">
1344
+ <xsl:apply-templates mode="schematron-select-full-path" select="." />
1345
+ </xsl:attribute>
1346
+ <svrl:text>
1347
+ Attribute @currencyID' marked as not used in the given context.</svrl:text>
1348
+ </svrl:successful-report>
1349
+ </xsl:if>
1350
+ <xsl:apply-templates mode="M9" select="@*|*" />
1351
+ </xsl:template>
1352
+
1353
+ <!--RULE -->
1354
+ <xsl:template match="/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:SpecifiedTradeSettlementHeaderMonetarySummation/ram:GrandTotalAmount" mode="M9" priority="1004">
1355
+ <svrl:fired-rule context="/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:SpecifiedTradeSettlementHeaderMonetarySummation/ram:GrandTotalAmount" />
1356
+
1357
+ <!--REPORT -->
1358
+ <xsl:if test="@currencyID">
1359
+ <svrl:successful-report test="@currencyID">
1360
+ <xsl:attribute name="location">
1361
+ <xsl:apply-templates mode="schematron-select-full-path" select="." />
1362
+ </xsl:attribute>
1363
+ <svrl:text>
1364
+ Attribute @currencyID' marked as not used in the given context.</svrl:text>
1365
+ </svrl:successful-report>
1366
+ </xsl:if>
1367
+ <xsl:apply-templates mode="M9" select="@*|*" />
1368
+ </xsl:template>
1369
+
1370
+ <!--RULE -->
1371
+ <xsl:template match="/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:SpecifiedTradeSettlementHeaderMonetarySummation/ram:TaxBasisTotalAmount" mode="M9" priority="1003">
1372
+ <svrl:fired-rule context="/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:SpecifiedTradeSettlementHeaderMonetarySummation/ram:TaxBasisTotalAmount" />
1373
+
1374
+ <!--REPORT -->
1375
+ <xsl:if test="@currencyID">
1376
+ <svrl:successful-report test="@currencyID">
1377
+ <xsl:attribute name="location">
1378
+ <xsl:apply-templates mode="schematron-select-full-path" select="." />
1379
+ </xsl:attribute>
1380
+ <svrl:text>
1381
+ Attribute @currencyID' marked as not used in the given context.</svrl:text>
1382
+ </svrl:successful-report>
1383
+ </xsl:if>
1384
+ <xsl:apply-templates mode="M9" select="@*|*" />
1385
+ </xsl:template>
1386
+
1387
+ <!--RULE -->
1388
+ <xsl:template match="/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:SpecifiedTradeSettlementHeaderMonetarySummation/ram:TaxTotalAmount[ not(@currencyID=../../ram:InvoiceCurrencyCode) and not(@currencyID=../../ram:TaxCurrencyCode)]" mode="M9" priority="1002">
1389
+ <svrl:fired-rule context="/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:SpecifiedTradeSettlementHeaderMonetarySummation/ram:TaxTotalAmount[ not(@currencyID=../../ram:InvoiceCurrencyCode) and not(@currencyID=../../ram:TaxCurrencyCode)]" />
1390
+
1391
+ <!--REPORT -->
1392
+ <xsl:if test="true()">
1393
+ <svrl:successful-report test="true()">
1394
+ <xsl:attribute name="location">
1395
+ <xsl:apply-templates mode="schematron-select-full-path" select="." />
1396
+ </xsl:attribute>
1397
+ <svrl:text>
1398
+ Element variant 'ram:TaxTotalAmount[ not(@currencyID=../../ram:InvoiceCurrencyCode) and not(@currencyID=../../ram:TaxCurrencyCode)]' is marked as not used in the given context.</svrl:text>
1399
+ </svrl:successful-report>
1400
+ </xsl:if>
1401
+ <xsl:apply-templates mode="M9" select="@*|*" />
1402
+ </xsl:template>
1403
+
1404
+ <!--RULE -->
1405
+ <xsl:template match="/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:SpecifiedTradeSettlementHeaderMonetarySummation/ram:TaxTotalAmount[@currencyID=../../ram:InvoiceCurrencyCode]" mode="M9" priority="1001">
1406
+ <svrl:fired-rule context="/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:SpecifiedTradeSettlementHeaderMonetarySummation/ram:TaxTotalAmount[@currencyID=../../ram:InvoiceCurrencyCode]" />
1407
+ <xsl:variable name="codeValue7" select="@currencyID" />
1408
+
1409
+ <!--ASSERT -->
1410
+ <xsl:choose>
1411
+ <xsl:when test="string-length($codeValue7)=0 or document('FACTUR-X_MINIMUM_codedb.xml')/codedb/cl[@id=7]/enumeration[@value=$codeValue7]" />
1412
+ <xsl:otherwise>
1413
+ <svrl:failed-assert test="string-length($codeValue7)=0 or document('FACTUR-X_MINIMUM_codedb.xml')/codedb/cl[@id=7]/enumeration[@value=$codeValue7]">
1414
+ <xsl:attribute name="id">FX-SCH-A-000045</xsl:attribute>
1415
+ <xsl:attribute name="location">
1416
+ <xsl:apply-templates mode="schematron-select-full-path" select="." />
1417
+ </xsl:attribute>
1418
+ <svrl:text>
1419
+ Value of '@currencyID' is not allowed.</svrl:text>
1420
+ </svrl:failed-assert>
1421
+ </xsl:otherwise>
1422
+ </xsl:choose>
1423
+ <xsl:apply-templates mode="M9" select="@*|*" />
1424
+ </xsl:template>
1425
+
1426
+ <!--RULE -->
1427
+ <xsl:template match="/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:SpecifiedTradeSettlementHeaderMonetarySummation/ram:TaxTotalAmount[@currencyID=../../ram:TaxCurrencyCode]" mode="M9" priority="1000">
1428
+ <svrl:fired-rule context="/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:SpecifiedTradeSettlementHeaderMonetarySummation/ram:TaxTotalAmount[@currencyID=../../ram:TaxCurrencyCode]" />
1429
+ <xsl:variable name="codeValue8" select="@currencyID" />
1430
+
1431
+ <!--ASSERT -->
1432
+ <xsl:choose>
1433
+ <xsl:when test="string-length($codeValue8)=0 or document('FACTUR-X_MINIMUM_codedb.xml')/codedb/cl[@id=8]/enumeration[@value=$codeValue8]" />
1434
+ <xsl:otherwise>
1435
+ <svrl:failed-assert test="string-length($codeValue8)=0 or document('FACTUR-X_MINIMUM_codedb.xml')/codedb/cl[@id=8]/enumeration[@value=$codeValue8]">
1436
+ <xsl:attribute name="id">FX-SCH-A-000414</xsl:attribute>
1437
+ <xsl:attribute name="location">
1438
+ <xsl:apply-templates mode="schematron-select-full-path" select="." />
1439
+ </xsl:attribute>
1440
+ <svrl:text>
1441
+ Value of '@currencyID' is not allowed.</svrl:text>
1442
+ </svrl:failed-assert>
1443
+ </xsl:otherwise>
1444
+ </xsl:choose>
1445
+ <xsl:apply-templates mode="M9" select="@*|*" />
1446
+ </xsl:template>
1447
+ <xsl:template match="text()" mode="M9" priority="-1" />
1448
+ <xsl:template match="@*|node()" mode="M9" priority="-2">
1449
+ <xsl:apply-templates mode="M9" select="@*|*" />
1450
+ </xsl:template>
1451
+ </xsl:stylesheet>