diff --git a/103120/examples/request1.xml b/103120/examples/request1.xml index 710f0f9c3aff4504604c44bd3fd59fedd0d44be7..d6d9abaed1c3cc409d08f91f757429c9d2771823 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 4f7ee5cd284184be5d7111d7dc47309c5afa4147..af4346d0b41b15388e10dc814dd088fd04cd3422 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 f7d67d5d799d620090f4ec2d51197fc8a8a9dda8..fb975776f7d83e1a00e45a699ed8cafc1e9582c8 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 5de3a81e669f8fc515403d283fb87b6224bd189f..daa4b57cbdacd87beee17c82f019793253ad7dbc 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 2f4136bdf7f77bd6ea00e7f13a2ed9d3e12eaf01..285d5e13227c9730dbf0eb10cf0fe86d19cd1e3e 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 0000000000000000000000000000000000000000..989165efe739485805ab277807f79a2763bed491 --- /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 e34e9e423700f23a221f6009fa7023c9332c0694..cc99dbc6cb02ee6aa216b93f622f3251fac6ab76 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 37a3571ecda8f3df03e9b38c6655276724851fcb..2f867c9944e89dde94c800d2f2aa6c890177c4ea 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 59c09aac32a1f1793319d381c64d4726662e721b..3e48fb7651a62d134295c49375c0e5878993a885 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 d367d691198b4705cc0b7be77808fb0229219a3d..ff14ab0fa94c6027e902e0f7865bc251fd4d7796 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 0000000000000000000000000000000000000000..a4c69c9f8ed804453c34c769ff5857600508ece4 --- /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 710f0f9c3aff4504604c44bd3fd59fedd0d44be7..d6d9abaed1c3cc409d08f91f757429c9d2771823 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 4f7ee5cd284184be5d7111d7dc47309c5afa4147..af4346d0b41b15388e10dc814dd088fd04cd3422 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 f7d67d5d799d620090f4ec2d51197fc8a8a9dda8..fb975776f7d83e1a00e45a699ed8cafc1e9582c8 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 5de3a81e669f8fc515403d283fb87b6224bd189f..daa4b57cbdacd87beee17c82f019793253ad7dbc 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 2f4136bdf7f77bd6ea00e7f13a2ed9d3e12eaf01..285d5e13227c9730dbf0eb10cf0fe86d19cd1e3e 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 0000000000000000000000000000000000000000..989165efe739485805ab277807f79a2763bed491 --- /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 e34e9e423700f23a221f6009fa7023c9332c0694..cc99dbc6cb02ee6aa216b93f622f3251fac6ab76 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 37a3571ecda8f3df03e9b38c6655276724851fcb..2f867c9944e89dde94c800d2f2aa6c890177c4ea 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 59c09aac32a1f1793319d381c64d4726662e721b..3e48fb7651a62d134295c49375c0e5878993a885 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 d367d691198b4705cc0b7be77808fb0229219a3d..ff14ab0fa94c6027e902e0f7865bc251fd4d7796 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 0000000000000000000000000000000000000000..a4c69c9f8ed804453c34c769ff5857600508ece4 --- /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 2f1dd90c889c0a222e9167358fccf74ccb7c679c..14b50d7e6005b76431f32dee18b8de5042e968c6 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 6d023f28361eb538bcf8f118798b7b0ff543ad63..6ebf3406d772ff43e074e620978839b1dcd45097 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 3dd81bc1f953b376f02b23166a759f617a392353..da3bc564ad4567ecfede36c7e8d83940d7e6b6e6 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 2ef9d7b0f06cd24be6c4b6c32f463002512e477b..5fb2536ca89c68c0bb21a6bb97ecf77bb95fed20 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 d1de8569cb1b88b6700e947cde375493cbbe3ecc..86b719295193146c4dcb25d6a1c5f0d43f366288 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 40681ade596440966e24c99463ee23162da13376..f52a502d7aaf697714f4853f4c7d647abd3ffcc7 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 d5b190fd7c89526024c7bd2f73b1836696cfe4db..ed8974ed70f7bf67d1a97b7b3e445682299c9d56 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 0000000000000000000000000000000000000000..60c611ca32a8ec342fc689a351e9960326d6fc3d --- /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 2f1dd90c889c0a222e9167358fccf74ccb7c679c..14b50d7e6005b76431f32dee18b8de5042e968c6 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 6d023f28361eb538bcf8f118798b7b0ff543ad63..6ebf3406d772ff43e074e620978839b1dcd45097 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 3dd81bc1f953b376f02b23166a759f617a392353..da3bc564ad4567ecfede36c7e8d83940d7e6b6e6 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 2ef9d7b0f06cd24be6c4b6c32f463002512e477b..5fb2536ca89c68c0bb21a6bb97ecf77bb95fed20 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 d1de8569cb1b88b6700e947cde375493cbbe3ecc..86b719295193146c4dcb25d6a1c5f0d43f366288 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 40681ade596440966e24c99463ee23162da13376..f52a502d7aaf697714f4853f4c7d647abd3ffcc7 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 d5b190fd7c89526024c7bd2f73b1836696cfe4db..ed8974ed70f7bf67d1a97b7b3e445682299c9d56 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 0000000000000000000000000000000000000000..60c611ca32a8ec342fc689a351e9960326d6fc3d --- /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