asserts |
Test | XPathDefaultNs | Annotation | let
$xml_file_path := string(base-uri()),
$last_slash_pos := index-of(string-to-codepoints(upper-case(string(base-uri()))), string-to-codepoints('/'))[last()],
$xml_file_name := substring($xml_file_path, $last_slash_pos + 1),
$schema_file_location := @xsi:noNamespaceSchemaLocation,
$schema_last_slash_pos := index-of(string-to-codepoints($schema_file_location), string-to-codepoints('/'))[last()],
$schema_name := substring($schema_file_location, $schema_last_slash_pos + 1),
$schema_type := substring-before(substring-after($schema_name, '.'), '.'),
$schema_type_upper := upper-case($schema_type),
$regex_pattern := concat('^', $schema_type_upper, '_.*')
return matches($xml_file_name, $regex_pattern) | | documentation | Typ raportu z nazwy pliku nie zgadza się z typem raportu wybranej XML schema. Typ raportu powinien być określony w nazwie pliku XML wielkimi literami. | documentation | ANULACJA_00001 |
| let
$report_date := tokenize(NazwaPliku, '_')[4]
return
if (string-length($report_date) = 6) then
let
$periods_dict := map {
'Q1': '03',
'Q2': '06',
'Q3': '09',
'Q4': '12',
'H1': '06',
'H2': '12'
},
$schema_file_location := @xsi:noNamespaceSchemaLocation,
$second_last_slash_pos := index-of(string-to-codepoints($schema_file_location), string-to-codepoints('/'))[last()-2],
$third_last_slash_pos := index-of(string-to-codepoints($schema_file_location), string-to-codepoints('/'))[last()-3],
$schema_date := concat(substring($schema_file_location, $third_last_slash_pos + 1, 4), substring($schema_file_location, $second_last_slash_pos + 1, 2)),
$report_date := if (substring($report_date, 5, 1) = 'Q' or substring($report_date, 5, 1) = 'H') then concat(substring($report_date, 1, 4), $periods_dict(substring($report_date, 5, 2))) else $report_date
return $schema_date = $report_date
else
let
$schema_file_location := @xsi:noNamespaceSchemaLocation,
$second_last_slash_pos := index-of(string-to-codepoints($schema_file_location), string-to-codepoints('/'))[last()-2],
$third_last_slash_pos := index-of(string-to-codepoints($schema_file_location), string-to-codepoints('/'))[last()-3],
$schema_date := concat(substring($schema_file_location, $third_last_slash_pos + 1, 4), substring($schema_file_location, $second_last_slash_pos + 1, 2))
return
$schema_date = substring($report_date, 1, 6) | | documentation | Należy użyć schemy XML dla odpowiedniego okresu (rok i miesiąc muszą odpowiadać dacie z elementu NazwaPliku) | documentation | ANULACJA_00002 |
| starts-with(@xsi:noNamespaceSchemaLocation, 'https://sprawozdawczosc.knf.gov.pl/') | | documentation | Należy odwołać się do schemy XML zamieszczonej na domenie: https://sprawozdawczosc.knf.gov.pl/ | documentation | ANULACJA_00003 |
| let
$xml_file_path := upper-case(string(base-uri())),
$last_slash_pos := index-of(string-to-codepoints(upper-case(string(base-uri()))), string-to-codepoints('/'))[last()],
$file_name_pattern := upper-case(string('[A-Z]+_[A-Z]+_[A-Z0-9]{11,11}_[A-Z0-9]{10,20}_[0-9QH]{4,8}_[0].xml')),
$xml_file_name := substring($xml_file_path, $last_slash_pos + 1)
return matches($xml_file_name, $file_name_pattern) | | documentation | Nazwa pliku niezgodna z maską | documentation | ANULACJA_00004 |
| let
$xml_file_path := upper-case(string(base-uri())),
$last_slash_pos := index-of(string-to-codepoints(upper-case(string(base-uri()))), string-to-codepoints('/'))[last()],
$xml_file_name := substring($xml_file_path, $last_slash_pos + 1),
$dash_pos := index-of(string-to-codepoints($xml_file_name), string-to-codepoints('_')),
$xml_file_name_nazwa_pliku := substring($xml_file_name, $dash_pos[1] + 1, $dash_pos[5] - $dash_pos[1] + 1)
return $xml_file_name_nazwa_pliku = NazwaPliku | | documentation | Nazwa pliku w treści pliku niezgodna z nazwą pliku xml | documentation | ANULACJA_00005 |
|
|