From f37dd5be66e4988586c256be6e0bb169e5a43896 Mon Sep 17 00:00:00 2001 From: mark Date: Mon, 15 Jun 2020 12:37:12 +0100 Subject: [PATCH] TS 103 120 v1.5.1 (2020-03-20) agreed at LI#53 (Sophia-Antipolis, 2020-02-04) --- 103120/examples/request1.xml | 2 +- 103120/examples/request2.xml | 2 +- 103120/examples/request3.xml | 2 +- 103120/examples/request4.xml | 2 +- ...ivery.xml => request5-Binary-Delivery.xml} | 27 +++--- 103120/examples/request5-XML-Delivery.xml | 82 +++++++++++++++++++ 103120/examples/response1.xml | 2 +- 103120/examples/response2.xml | 2 +- 103120/examples/response3.xml | 2 +- 103120/examples/response4.xml | 2 +- 103120/examples/response5.xml | 37 +++++++++ 103120/portal/examples/request1.xml | 2 +- 103120/portal/examples/request2.xml | 2 +- 103120/portal/examples/request3.xml | 2 +- 103120/portal/examples/request4.xml | 2 +- ...ivery.xml => request5-Binary-Delivery.xml} | 27 +++--- .../portal/examples/request5-XML-Delivery.xml | 82 +++++++++++++++++++ 103120/portal/examples/response1.xml | 2 +- 103120/portal/examples/response2.xml | 2 +- 103120/portal/examples/response3.xml | 2 +- 103120/portal/examples/response4.xml | 2 +- 103120/portal/examples/response5.xml | 37 +++++++++ ...d => ts_103120v010501p0_Authorisation.xsd} | 6 +- ...mmon.xsd => ts_103120v010501p0_Common.xsd} | 2 +- ...0_Core.xsd => ts_103120v010501p0_Core.xsd} | 13 ++- ...ry.xsd => ts_103120v010501p0_Delivery.xsd} | 50 +++++++++-- ...nt.xsd => ts_103120v010501p0_Document.xsd} | 6 +- ...sd => ts_103120v010501p0_Notification.xsd} | 6 +- ...0_Task.xsd => ts_103120v010501p0_Task.xsd} | 6 +- 103120/portal/validate_examples.py | 42 ++++++++++ 103120/schema/ts_103120_Authorisation.xsd | 6 +- 103120/schema/ts_103120_Common.xsd | 2 +- 103120/schema/ts_103120_Core.xsd | 13 ++- 103120/schema/ts_103120_Delivery.xsd | 50 +++++++++-- 103120/schema/ts_103120_Document.xsd | 6 +- 103120/schema/ts_103120_Notification.xsd | 6 +- 103120/schema/ts_103120_Task.xsd | 6 +- 103120/validate_examples.py | 42 ++++++++++ 38 files changed, 496 insertions(+), 90 deletions(-) rename 103120/examples/{response4-delivery.xml => request5-Binary-Delivery.xml} (76%) create mode 100644 103120/examples/request5-XML-Delivery.xml create mode 100644 103120/examples/response5.xml rename 103120/portal/examples/{response4-delivery.xml => request5-Binary-Delivery.xml} (76%) create mode 100644 103120/portal/examples/request5-XML-Delivery.xml create mode 100644 103120/portal/examples/response5.xml rename 103120/portal/schema/{ts_103120v010401p0_Authorisation.xsd => ts_103120v010501p0_Authorisation.xsd} (95%) rename 103120/portal/schema/{ts_103120v010401p0_Common.xsd => ts_103120v010501p0_Common.xsd} (98%) rename 103120/portal/schema/{ts_103120v010401p0_Core.xsd => ts_103120v010501p0_Core.xsd} (96%) rename 103120/portal/schema/{ts_103120v010401p0_Delivery.xsd => ts_103120v010501p0_Delivery.xsd} (62%) rename 103120/portal/schema/{ts_103120v010401p0_Document.xsd => ts_103120v010501p0_Document.xsd} (95%) rename 103120/portal/schema/{ts_103120v010401p0_Notification.xsd => ts_103120v010501p0_Notification.xsd} (91%) rename 103120/portal/schema/{ts_103120v010401p0_Task.xsd => ts_103120v010501p0_Task.xsd} (98%) create mode 100644 103120/portal/validate_examples.py create mode 100644 103120/validate_examples.py diff --git a/103120/examples/request1.xml b/103120/examples/request1.xml index 710f0f9..d6d9aba 100644 --- a/103120/examples/request1.xml +++ b/103120/examples/request1.xml @@ -12,7 +12,7 @@ c02358b2-76cf-4ba4-a8eb-f6436ccaea2e 2015-09-01T12:00:00.000000Z - V1.2.1 + V1.5.1 XX v1.0 diff --git a/103120/examples/request2.xml b/103120/examples/request2.xml index 4f7ee5c..af4346d 100644 --- a/103120/examples/request2.xml +++ b/103120/examples/request2.xml @@ -12,7 +12,7 @@ 45002c1e-dc4a-470a-9152-8e752638c86c 2015-09-01T12:01:00.000000Z - V1.2.1 + V1.5.1 XX v1.0 diff --git a/103120/examples/request3.xml b/103120/examples/request3.xml index f7d67d5..fb97577 100644 --- a/103120/examples/request3.xml +++ b/103120/examples/request3.xml @@ -12,7 +12,7 @@ 69353ac0-9582-4c71-b162-86259c99de20 2015-09-01T12:02:00.000000Z - V1.2.1 + V1.5.1 XX v1.0 diff --git a/103120/examples/request4.xml b/103120/examples/request4.xml index 5de3a81..daa4b57 100644 --- a/103120/examples/request4.xml +++ b/103120/examples/request4.xml @@ -12,7 +12,7 @@ c02358b2-76cf-4ba4-a8eb-f6436ccaea2e 2019-09-30T13:37:00.000000Z - V1.3.1 + V1.5.1 XX v1.0 diff --git a/103120/examples/response4-delivery.xml b/103120/examples/request5-Binary-Delivery.xml similarity index 76% rename from 103120/examples/response4-delivery.xml rename to 103120/examples/request5-Binary-Delivery.xml index 2f4136b..285d5e1 100644 --- a/103120/examples/response4-delivery.xml +++ b/103120/examples/request5-Binary-Delivery.xml @@ -12,17 +12,18 @@ 8854cfad-44ac-43b8-99ae-530b690b43da 2019-09-30T13:37:37.000000Z - V1.3.1 + V1.5.1 XX v1.0 - - - + + + 0 - + + 71ff52ca-bcea-4fa3-b34e-1b89dcfb0d9e 71ff52ca-bcea-4fa3-b34e-1b89dcfb0d9e @@ -42,14 +43,16 @@ - PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4= - text/xml - d8ecb368c8dd3b353b775d5cd2cca7a621e9956ec3b150f445ce4d4d48a4dff3 + + VGhpcyBpc24ndCBhY3R1YWxseSBhbiBpbWFnZS4= + image/jpeg + 98ecb6a08c34a97f6edc0e97ddcd32cb139e2253825186a817ddb24997ccd68f + - - - - + + + + diff --git a/103120/examples/request5-XML-Delivery.xml b/103120/examples/request5-XML-Delivery.xml new file mode 100644 index 0000000..989165e --- /dev/null +++ b/103120/examples/request5-XML-Delivery.xml @@ -0,0 +1,82 @@ + + +
+ + XX + SENDER01 + + + XX + RECEIVER01 + + 8854cfad-44ac-43b8-99ae-530b690b43da + 2019-09-30T13:37:37.000000Z + + V1.5.1 + XX + v1.0 + +
+ + + + + 0 + + 71ff52ca-bcea-4fa3-b34e-1b89dcfb0d9e + + 71ff52ca-bcea-4fa3-b34e-1b89dcfb0d9e + + 2b36a78b-b628-416d-bd22-404e68a0cd36 + + + ExampleLIID + + d1079830-8e9a-4731-8fb7-36b9b961eb72 + 1 + true + + + http://FooServiceSchema.example.com/schema/v1.1.1/ + + + + + + + + + + + + + + + + + + + + + + + + + + + Foo + Bar + Baz + + + + + + + + + +
diff --git a/103120/examples/response1.xml b/103120/examples/response1.xml index e34e9e4..cc99dbc 100644 --- a/103120/examples/response1.xml +++ b/103120/examples/response1.xml @@ -12,7 +12,7 @@ c02358b2-76cf-4ba4-a8eb-f6436ccaea2e 2015-09-01T12:00:01.000000Z - V1.2.1 + V1.5.1 XX v1.0 diff --git a/103120/examples/response2.xml b/103120/examples/response2.xml index 37a3571..2f867c9 100644 --- a/103120/examples/response2.xml +++ b/103120/examples/response2.xml @@ -12,7 +12,7 @@ 45002c1e-dc4a-470a-9152-8e752638c86c 2015-09-01T12:01:00.000000Z - V1.2.1 + V1.5.1 XX v1.0 diff --git a/103120/examples/response3.xml b/103120/examples/response3.xml index 59c09aa..3e48fb7 100644 --- a/103120/examples/response3.xml +++ b/103120/examples/response3.xml @@ -12,7 +12,7 @@ 69353ac0-9582-4c71-b162-86259c99de20 2015-09-01T12:02:00.000000Z - V1.2.1 + V1.5.1 XX v1.0 diff --git a/103120/examples/response4.xml b/103120/examples/response4.xml index d367d69..ff14ab0 100644 --- a/103120/examples/response4.xml +++ b/103120/examples/response4.xml @@ -12,7 +12,7 @@ c02358b2-76cf-4ba4-a8eb-f6436ccaea2e 2019-09-30T13:37:01.000000Z - V1.3.1 + V1.5.1 XX v1.0 diff --git a/103120/examples/response5.xml b/103120/examples/response5.xml new file mode 100644 index 0000000..a4c69c9 --- /dev/null +++ b/103120/examples/response5.xml @@ -0,0 +1,37 @@ + + +
+ + XX + SENDER01 + + + XX + RECEIVER01 + + 8854cfad-44ac-43b8-99ae-530b690b43da + 2019-09-30T13:37:37.000000Z + + V1.5.1 + XX + v1.0 + +
+ + + + + 0 + + 71ff52ca-bcea-4fa3-b34e-1b89dcfb0d9e + + + + + +
diff --git a/103120/portal/examples/request1.xml b/103120/portal/examples/request1.xml index 710f0f9..d6d9aba 100644 --- a/103120/portal/examples/request1.xml +++ b/103120/portal/examples/request1.xml @@ -12,7 +12,7 @@ c02358b2-76cf-4ba4-a8eb-f6436ccaea2e 2015-09-01T12:00:00.000000Z - V1.2.1 + V1.5.1 XX v1.0 diff --git a/103120/portal/examples/request2.xml b/103120/portal/examples/request2.xml index 4f7ee5c..af4346d 100644 --- a/103120/portal/examples/request2.xml +++ b/103120/portal/examples/request2.xml @@ -12,7 +12,7 @@ 45002c1e-dc4a-470a-9152-8e752638c86c 2015-09-01T12:01:00.000000Z - V1.2.1 + V1.5.1 XX v1.0 diff --git a/103120/portal/examples/request3.xml b/103120/portal/examples/request3.xml index f7d67d5..fb97577 100644 --- a/103120/portal/examples/request3.xml +++ b/103120/portal/examples/request3.xml @@ -12,7 +12,7 @@ 69353ac0-9582-4c71-b162-86259c99de20 2015-09-01T12:02:00.000000Z - V1.2.1 + V1.5.1 XX v1.0 diff --git a/103120/portal/examples/request4.xml b/103120/portal/examples/request4.xml index 5de3a81..daa4b57 100644 --- a/103120/portal/examples/request4.xml +++ b/103120/portal/examples/request4.xml @@ -12,7 +12,7 @@ c02358b2-76cf-4ba4-a8eb-f6436ccaea2e 2019-09-30T13:37:00.000000Z - V1.3.1 + V1.5.1 XX v1.0 diff --git a/103120/portal/examples/response4-delivery.xml b/103120/portal/examples/request5-Binary-Delivery.xml similarity index 76% rename from 103120/portal/examples/response4-delivery.xml rename to 103120/portal/examples/request5-Binary-Delivery.xml index 2f4136b..285d5e1 100644 --- a/103120/portal/examples/response4-delivery.xml +++ b/103120/portal/examples/request5-Binary-Delivery.xml @@ -12,17 +12,18 @@ 8854cfad-44ac-43b8-99ae-530b690b43da 2019-09-30T13:37:37.000000Z - V1.3.1 + V1.5.1 XX v1.0 - - - + + + 0 - + + 71ff52ca-bcea-4fa3-b34e-1b89dcfb0d9e 71ff52ca-bcea-4fa3-b34e-1b89dcfb0d9e @@ -42,14 +43,16 @@ - PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4= - text/xml - d8ecb368c8dd3b353b775d5cd2cca7a621e9956ec3b150f445ce4d4d48a4dff3 + + VGhpcyBpc24ndCBhY3R1YWxseSBhbiBpbWFnZS4= + image/jpeg + 98ecb6a08c34a97f6edc0e97ddcd32cb139e2253825186a817ddb24997ccd68f + - - - - + + + + diff --git a/103120/portal/examples/request5-XML-Delivery.xml b/103120/portal/examples/request5-XML-Delivery.xml new file mode 100644 index 0000000..989165e --- /dev/null +++ b/103120/portal/examples/request5-XML-Delivery.xml @@ -0,0 +1,82 @@ + + +
+ + XX + SENDER01 + + + XX + RECEIVER01 + + 8854cfad-44ac-43b8-99ae-530b690b43da + 2019-09-30T13:37:37.000000Z + + V1.5.1 + XX + v1.0 + +
+ + + + + 0 + + 71ff52ca-bcea-4fa3-b34e-1b89dcfb0d9e + + 71ff52ca-bcea-4fa3-b34e-1b89dcfb0d9e + + 2b36a78b-b628-416d-bd22-404e68a0cd36 + + + ExampleLIID + + d1079830-8e9a-4731-8fb7-36b9b961eb72 + 1 + true + + + http://FooServiceSchema.example.com/schema/v1.1.1/ + + + + + + + + + + + + + + + + + + + + + + + + + + + Foo + Bar + Baz + + + + + + + + + +
diff --git a/103120/portal/examples/response1.xml b/103120/portal/examples/response1.xml index e34e9e4..cc99dbc 100644 --- a/103120/portal/examples/response1.xml +++ b/103120/portal/examples/response1.xml @@ -12,7 +12,7 @@ c02358b2-76cf-4ba4-a8eb-f6436ccaea2e 2015-09-01T12:00:01.000000Z - V1.2.1 + V1.5.1 XX v1.0 diff --git a/103120/portal/examples/response2.xml b/103120/portal/examples/response2.xml index 37a3571..2f867c9 100644 --- a/103120/portal/examples/response2.xml +++ b/103120/portal/examples/response2.xml @@ -12,7 +12,7 @@ 45002c1e-dc4a-470a-9152-8e752638c86c 2015-09-01T12:01:00.000000Z - V1.2.1 + V1.5.1 XX v1.0 diff --git a/103120/portal/examples/response3.xml b/103120/portal/examples/response3.xml index 59c09aa..3e48fb7 100644 --- a/103120/portal/examples/response3.xml +++ b/103120/portal/examples/response3.xml @@ -12,7 +12,7 @@ 69353ac0-9582-4c71-b162-86259c99de20 2015-09-01T12:02:00.000000Z - V1.2.1 + V1.5.1 XX v1.0 diff --git a/103120/portal/examples/response4.xml b/103120/portal/examples/response4.xml index d367d69..ff14ab0 100644 --- a/103120/portal/examples/response4.xml +++ b/103120/portal/examples/response4.xml @@ -12,7 +12,7 @@ c02358b2-76cf-4ba4-a8eb-f6436ccaea2e 2019-09-30T13:37:01.000000Z - V1.3.1 + V1.5.1 XX v1.0 diff --git a/103120/portal/examples/response5.xml b/103120/portal/examples/response5.xml new file mode 100644 index 0000000..a4c69c9 --- /dev/null +++ b/103120/portal/examples/response5.xml @@ -0,0 +1,37 @@ + + +
+ + XX + SENDER01 + + + XX + RECEIVER01 + + 8854cfad-44ac-43b8-99ae-530b690b43da + 2019-09-30T13:37:37.000000Z + + V1.5.1 + XX + v1.0 + +
+ + + + + 0 + + 71ff52ca-bcea-4fa3-b34e-1b89dcfb0d9e + + + + + +
diff --git a/103120/portal/schema/ts_103120v010401p0_Authorisation.xsd b/103120/portal/schema/ts_103120v010501p0_Authorisation.xsd similarity index 95% rename from 103120/portal/schema/ts_103120v010401p0_Authorisation.xsd rename to 103120/portal/schema/ts_103120v010501p0_Authorisation.xsd index 2f1dd90..14b50d7 100644 --- a/103120/portal/schema/ts_103120v010401p0_Authorisation.xsd +++ b/103120/portal/schema/ts_103120v010501p0_Authorisation.xsd @@ -8,9 +8,9 @@ elementFormDefault="qualified" attributeFormDefault="unqualified"> - - - + + + diff --git a/103120/portal/schema/ts_103120v010401p0_Common.xsd b/103120/portal/schema/ts_103120v010501p0_Common.xsd similarity index 98% rename from 103120/portal/schema/ts_103120v010401p0_Common.xsd rename to 103120/portal/schema/ts_103120v010501p0_Common.xsd index 6d023f2..6ebf340 100644 --- a/103120/portal/schema/ts_103120v010401p0_Common.xsd +++ b/103120/portal/schema/ts_103120v010501p0_Common.xsd @@ -6,7 +6,7 @@ elementFormDefault="qualified" attributeFormDefault="unqualified"> - + diff --git a/103120/portal/schema/ts_103120v010401p0_Core.xsd b/103120/portal/schema/ts_103120v010501p0_Core.xsd similarity index 96% rename from 103120/portal/schema/ts_103120v010401p0_Core.xsd rename to 103120/portal/schema/ts_103120v010501p0_Core.xsd index 3dd81bc..da3bc56 100644 --- a/103120/portal/schema/ts_103120v010401p0_Core.xsd +++ b/103120/portal/schema/ts_103120v010501p0_Core.xsd @@ -7,8 +7,8 @@ elementFormDefault="qualified" attributeFormDefault="unqualified"> - - + + @@ -75,6 +75,7 @@ + @@ -151,11 +152,17 @@ - + + + + + + + diff --git a/103120/portal/schema/ts_103120v010401p0_Delivery.xsd b/103120/portal/schema/ts_103120v010501p0_Delivery.xsd similarity index 62% rename from 103120/portal/schema/ts_103120v010401p0_Delivery.xsd rename to 103120/portal/schema/ts_103120v010501p0_Delivery.xsd index 2ef9d7b..5fb2536 100644 --- a/103120/portal/schema/ts_103120v010401p0_Delivery.xsd +++ b/103120/portal/schema/ts_103120v010501p0_Delivery.xsd @@ -8,9 +8,9 @@ elementFormDefault="qualified" attributeFormDefault="unqualified"> - - - + + + @@ -27,26 +27,58 @@ - + + + + + + + + + - - - + + + + + + + + + + + + + + + + + + + + + - + - + + + + + + + diff --git a/103120/portal/schema/ts_103120v010401p0_Document.xsd b/103120/portal/schema/ts_103120v010501p0_Document.xsd similarity index 95% rename from 103120/portal/schema/ts_103120v010401p0_Document.xsd rename to 103120/portal/schema/ts_103120v010501p0_Document.xsd index d1de856..86b7192 100644 --- a/103120/portal/schema/ts_103120v010401p0_Document.xsd +++ b/103120/portal/schema/ts_103120v010501p0_Document.xsd @@ -8,9 +8,9 @@ elementFormDefault="qualified" attributeFormDefault="unqualified"> - - - + + + diff --git a/103120/portal/schema/ts_103120v010401p0_Notification.xsd b/103120/portal/schema/ts_103120v010501p0_Notification.xsd similarity index 91% rename from 103120/portal/schema/ts_103120v010401p0_Notification.xsd rename to 103120/portal/schema/ts_103120v010501p0_Notification.xsd index 40681ad..f52a502 100644 --- a/103120/portal/schema/ts_103120v010401p0_Notification.xsd +++ b/103120/portal/schema/ts_103120v010501p0_Notification.xsd @@ -8,9 +8,9 @@ elementFormDefault="qualified" attributeFormDefault="unqualified"> - - - + + + diff --git a/103120/portal/schema/ts_103120v010401p0_Task.xsd b/103120/portal/schema/ts_103120v010501p0_Task.xsd similarity index 98% rename from 103120/portal/schema/ts_103120v010401p0_Task.xsd rename to 103120/portal/schema/ts_103120v010501p0_Task.xsd index d5b190f..ed8974e 100644 --- a/103120/portal/schema/ts_103120v010401p0_Task.xsd +++ b/103120/portal/schema/ts_103120v010501p0_Task.xsd @@ -8,9 +8,9 @@ elementFormDefault="qualified" attributeFormDefault="unqualified"> - - - + + + diff --git a/103120/portal/validate_examples.py b/103120/portal/validate_examples.py new file mode 100644 index 0000000..60c611c --- /dev/null +++ b/103120/portal/validate_examples.py @@ -0,0 +1,42 @@ +import glob +import sys +from pathlib import Path +from pprint import pprint + +if __name__ == '__main__': + + if sys.version_info <= (3, 5): + sys.exit('ERROR: You need at least Python 3.5 to run this tool') + + try: + from lxml import etree + except ImportError: + sys.exit('ERROR: You need to install the Python lxml library') + + try: + import xmlschema + except ImportError: + sys.exit('ERROR: You need to install the xml schema library') + + + locations = [] + schemaFiles = glob.glob('schema/*.xsd') + for schemaFile in schemaFiles: + xs = xmlschema.XMLSchema(schemaFile, validation='skip') + locations.append((xs.default_namespace, str(Path(schemaFile))[7:])) + + coreSchema = xmlschema.XMLSchema('schema/ts_103120v010501p0_Core.xsd', locations=locations) + + for schema in schemaFiles: + newSchema = xmlschema.XMLSchema(schema, locations=locations) + coreSchema.import_schema(newSchema.default_namespace, schema) + + examples = glob.glob('examples/*.xml') + for example in examples: + try: + coreSchema.validate(example) + print ("{0} passed validation".format(example)) + except Exception as ex: + print ("{0} failed validation: {1}".format(example, ex)) + + print ('Done') \ No newline at end of file diff --git a/103120/schema/ts_103120_Authorisation.xsd b/103120/schema/ts_103120_Authorisation.xsd index 2f1dd90..14b50d7 100644 --- a/103120/schema/ts_103120_Authorisation.xsd +++ b/103120/schema/ts_103120_Authorisation.xsd @@ -8,9 +8,9 @@ elementFormDefault="qualified" attributeFormDefault="unqualified"> - - - + + + diff --git a/103120/schema/ts_103120_Common.xsd b/103120/schema/ts_103120_Common.xsd index 6d023f2..6ebf340 100644 --- a/103120/schema/ts_103120_Common.xsd +++ b/103120/schema/ts_103120_Common.xsd @@ -6,7 +6,7 @@ elementFormDefault="qualified" attributeFormDefault="unqualified"> - + diff --git a/103120/schema/ts_103120_Core.xsd b/103120/schema/ts_103120_Core.xsd index 3dd81bc..da3bc56 100644 --- a/103120/schema/ts_103120_Core.xsd +++ b/103120/schema/ts_103120_Core.xsd @@ -7,8 +7,8 @@ elementFormDefault="qualified" attributeFormDefault="unqualified"> - - + + @@ -75,6 +75,7 @@ + @@ -151,11 +152,17 @@ - + + + + + + + diff --git a/103120/schema/ts_103120_Delivery.xsd b/103120/schema/ts_103120_Delivery.xsd index 2ef9d7b..5fb2536 100644 --- a/103120/schema/ts_103120_Delivery.xsd +++ b/103120/schema/ts_103120_Delivery.xsd @@ -8,9 +8,9 @@ elementFormDefault="qualified" attributeFormDefault="unqualified"> - - - + + + @@ -27,26 +27,58 @@ - + + + + + + + + + - - - + + + + + + + + + + + + + + + + + + + + + - + - + + + + + + + diff --git a/103120/schema/ts_103120_Document.xsd b/103120/schema/ts_103120_Document.xsd index d1de856..86b7192 100644 --- a/103120/schema/ts_103120_Document.xsd +++ b/103120/schema/ts_103120_Document.xsd @@ -8,9 +8,9 @@ elementFormDefault="qualified" attributeFormDefault="unqualified"> - - - + + + diff --git a/103120/schema/ts_103120_Notification.xsd b/103120/schema/ts_103120_Notification.xsd index 40681ad..f52a502 100644 --- a/103120/schema/ts_103120_Notification.xsd +++ b/103120/schema/ts_103120_Notification.xsd @@ -8,9 +8,9 @@ elementFormDefault="qualified" attributeFormDefault="unqualified"> - - - + + + diff --git a/103120/schema/ts_103120_Task.xsd b/103120/schema/ts_103120_Task.xsd index d5b190f..ed8974e 100644 --- a/103120/schema/ts_103120_Task.xsd +++ b/103120/schema/ts_103120_Task.xsd @@ -8,9 +8,9 @@ elementFormDefault="qualified" attributeFormDefault="unqualified"> - - - + + + diff --git a/103120/validate_examples.py b/103120/validate_examples.py new file mode 100644 index 0000000..60c611c --- /dev/null +++ b/103120/validate_examples.py @@ -0,0 +1,42 @@ +import glob +import sys +from pathlib import Path +from pprint import pprint + +if __name__ == '__main__': + + if sys.version_info <= (3, 5): + sys.exit('ERROR: You need at least Python 3.5 to run this tool') + + try: + from lxml import etree + except ImportError: + sys.exit('ERROR: You need to install the Python lxml library') + + try: + import xmlschema + except ImportError: + sys.exit('ERROR: You need to install the xml schema library') + + + locations = [] + schemaFiles = glob.glob('schema/*.xsd') + for schemaFile in schemaFiles: + xs = xmlschema.XMLSchema(schemaFile, validation='skip') + locations.append((xs.default_namespace, str(Path(schemaFile))[7:])) + + coreSchema = xmlschema.XMLSchema('schema/ts_103120v010501p0_Core.xsd', locations=locations) + + for schema in schemaFiles: + newSchema = xmlschema.XMLSchema(schema, locations=locations) + coreSchema.import_schema(newSchema.default_namespace, schema) + + examples = glob.glob('examples/*.xml') + for example in examples: + try: + coreSchema.validate(example) + print ("{0} passed validation".format(example)) + except Exception as ex: + print ("{0} failed validation: {1}".format(example, ex)) + + print ('Done') \ No newline at end of file -- GitLab