From 15d3d9c9fcf53c4580a6b2238642f8aa9c57c117 Mon Sep 17 00:00:00 2001 From: Eric F Date: Tue, 6 Apr 2021 19:18:18 +0200 Subject: [PATCH] Ajout d'un cas test de projection xsd des matrices --- Tests/MappingAccasXsd/Matrix/Matrix.xsd | 52 +++++++++++++++++++ Tests/MappingAccasXsd/Matrix/Matrix_V0.xsd | 45 ++++++++++++++++ Tests/MappingAccasXsd/Matrix/matrix_1.xml | 9 ++++ Tests/MappingAccasXsd/Matrix/matrix_V0.xml | 11 ++++ Tests/MappingAccasXsd/Matrix/readExemple.py | 14 +++++ .../MappingAccasXsd/Matrix/readExemple_V0.py | 14 +++++ Tests/MappingAccasXsd/Matrix/spec_1.xml | 38 ++++++++++++++ 7 files changed, 183 insertions(+) create mode 100644 Tests/MappingAccasXsd/Matrix/Matrix.xsd create mode 100644 Tests/MappingAccasXsd/Matrix/Matrix_V0.xsd create mode 100644 Tests/MappingAccasXsd/Matrix/matrix_1.xml create mode 100644 Tests/MappingAccasXsd/Matrix/matrix_V0.xml create mode 100644 Tests/MappingAccasXsd/Matrix/readExemple.py create mode 100644 Tests/MappingAccasXsd/Matrix/readExemple_V0.py create mode 100644 Tests/MappingAccasXsd/Matrix/spec_1.xml diff --git a/Tests/MappingAccasXsd/Matrix/Matrix.xsd b/Tests/MappingAccasXsd/Matrix/Matrix.xsd new file mode 100644 index 00000000..e1223d62 --- /dev/null +++ b/Tests/MappingAccasXsd/Matrix/Matrix.xsd @@ -0,0 +1,52 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Tests/MappingAccasXsd/Matrix/Matrix_V0.xsd b/Tests/MappingAccasXsd/Matrix/Matrix_V0.xsd new file mode 100644 index 00000000..374bbdac --- /dev/null +++ b/Tests/MappingAccasXsd/Matrix/Matrix_V0.xsd @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Tests/MappingAccasXsd/Matrix/matrix_1.xml b/Tests/MappingAccasXsd/Matrix/matrix_1.xml new file mode 100644 index 00000000..84e637c5 --- /dev/null +++ b/Tests/MappingAccasXsd/Matrix/matrix_1.xml @@ -0,0 +1,9 @@ + + + + + 0 1 2 3 + 4 5 6 7 + 8 9 10 11 + + diff --git a/Tests/MappingAccasXsd/Matrix/matrix_V0.xml b/Tests/MappingAccasXsd/Matrix/matrix_V0.xml new file mode 100644 index 00000000..2977f220 --- /dev/null +++ b/Tests/MappingAccasXsd/Matrix/matrix_V0.xml @@ -0,0 +1,11 @@ + + + + + + 0 1 2 3 + 4 5 6 7 + 8 9 10 12 + + + diff --git a/Tests/MappingAccasXsd/Matrix/readExemple.py b/Tests/MappingAccasXsd/Matrix/readExemple.py new file mode 100644 index 00000000..7d72eee8 --- /dev/null +++ b/Tests/MappingAccasXsd/Matrix/readExemple.py @@ -0,0 +1,14 @@ +from Matrix_manualdriver import * + +pyxb.GlobalValidationConfig._setContentInfluencesGeneration(pyxb.GlobalValidationConfig.ALWAYS) +pyxb.GlobalValidationConfig._setInvalidElementInContent(pyxb.GlobalValidationConfig.RAISE_EXCEPTION) +pyxb.GlobalValidationConfig._setOrphanElementInContent(pyxb.GlobalValidationConfig.RAISE_EXCEPTION) + + +jdd = CreateFromDocument(open('matrix_1.xml').read()) +print (jdd.toDOM().toprettyxml()) +c1=jdd.step_Vimmp[0] +c1.simp5 +c1.simp5.line[0] +c1.simp5.line[0][2] + diff --git a/Tests/MappingAccasXsd/Matrix/readExemple_V0.py b/Tests/MappingAccasXsd/Matrix/readExemple_V0.py new file mode 100644 index 00000000..00713593 --- /dev/null +++ b/Tests/MappingAccasXsd/Matrix/readExemple_V0.py @@ -0,0 +1,14 @@ +from Matrix_manualdriver import * + +pyxb.GlobalValidationConfig._setContentInfluencesGeneration(pyxb.GlobalValidationConfig.ALWAYS) +pyxb.GlobalValidationConfig._setInvalidElementInContent(pyxb.GlobalValidationConfig.RAISE_EXCEPTION) +pyxb.GlobalValidationConfig._setOrphanElementInContent(pyxb.GlobalValidationConfig.RAISE_EXCEPTION) + + +jdd = CreateFromDocument(open('matrix_V0.xml').read()) +print (jdd.toDOM().toprettyxml()) +c1=jdd.step_Vimmp[0] +c1.simp5 +c1.simp5.line[0] +c1.simp5.line[0][2] + diff --git a/Tests/MappingAccasXsd/Matrix/spec_1.xml b/Tests/MappingAccasXsd/Matrix/spec_1.xml new file mode 100644 index 00000000..e0d4875c --- /dev/null +++ b/Tests/MappingAccasXsd/Matrix/spec_1.xml @@ -0,0 +1,38 @@ + + + + + + + Ma chaine unique + + + +Ma_chaine_n°0 Ma_chaine_n°1 Ma_chaine_n°2 + + + + Ma chaine n°0 + Ma chaine n°1 + Ma chaine n°2 + + + + + 3 cm 4 m + 1 cm 5 m + 2 cm 6 m + 3 cm 7 m + + + + + + 1 2 3 4 + 5 6 7 8 + 9 10 11 12 + + + + + -- 2.39.2