From 4299abc0d38823c641cd49c5c191c9189b2bf2e6 Mon Sep 17 00:00:00 2001 From: Eric F Date: Thu, 9 Apr 2020 15:13:54 +0200 Subject: [PATCH] =?utf8?q?Corrections=20li=C3=A9s=20=C3=A0=20l''int=C3=A9g?= =?utf8?q?ration=20d'eficas=20en=20temps=20que=20submodule=20ds=20vimmptra?= =?utf8?q?ining?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- Efi2Xsd/AccasXsd.py | 8 +- Vimmp/Makefile | 84 +- Vimmp/XMLSchema11_local.xsd | 1950 +++++++++++++++++++++++++++++++++++ Vimmp/xml.xsd | 286 +++++ 4 files changed, 2305 insertions(+), 23 deletions(-) create mode 100755 Vimmp/XMLSchema11_local.xsd create mode 100644 Vimmp/xml.xsd diff --git a/Efi2Xsd/AccasXsd.py b/Efi2Xsd/AccasXsd.py index f4acc10b..db3283cf 100755 --- a/Efi2Xsd/AccasXsd.py +++ b/Efi2Xsd/AccasXsd.py @@ -173,7 +173,7 @@ class X_compoFactoriseAmbigu(X_definition): def construitEntites(self, laListe): for mc in laListe : - if self.entites.has_key(mc.nom): self.entites[mc.nom].append(mc) + if mc.nom in self.entites.keys() : self.entites[mc.nom].append(mc) else : self.entites[mc.nom] = [mc,] self.construitEntites(mc.mcXSD) @@ -196,8 +196,8 @@ class X_compoFactoriseAmbigu(X_definition): if objMC.label == 'BLOC' : blocContenus.append(objMC) for b in blocContenus : - for frere in blocContenus [blocContenus.index(b)+1 :] : - if b.isDisjoint(frere) : continue + for frere in blocContenus[blocContenus.index(b)+1:]: + if b.isDisjoint(frere) : continue aAjouter=False break if not aAjouter : break @@ -256,7 +256,7 @@ class X_compoFactoriseAmbigu(X_definition): for ligne in laListe : - if aReduire.has_key(ligne[0]) : + if ligne[0] in aReduire.keys(): if len(ligne) == 1 :aReduire[ligne[0]].append([]) else : aReduire[ligne[0]].append(ligne[1:]) else : diff --git a/Vimmp/Makefile b/Vimmp/Makefile index 53d500a5..09913407 100644 --- a/Vimmp/Makefile +++ b/Vimmp/Makefile @@ -1,33 +1,79 @@ SUFFIXES= .xsd +# .SUFFIXES= .xsd _genere.xsd _genere.py -PYXB=/local/PyXB-1.2.6/scripts/pyxbgen -PYXB_PYTHONPATH=/local/PyXB-1.2.6.bin/lib/python2.7/site-packages/ +# PN : +# PYXB=/local/PyXB-1.2.6/scripts/pyxbgen +# PYXB_PYTHONPATH=/local/PyXB-1.2.6.bin/lib/python2.7/site-packages/ -#$(PYXB) -m $(basename $@) -u $< --location-prefix-rewrite http://chercheurs.edf.com/logiciels/vimmp= --write-for-customization \ -# L'utilisation de $? ne fonctionne pas s'il on modifie qu'un catalogue car il ne redonne pas le fichier non modifier et pyxb détecte -# que l'autre fichier en dépend et n'est pas regénéré : $^ +#ifeq ($(origin PRODUCTS_DIR), undefined) +# PRODUCTS_DIR=${HOME}/products +#endif +PRODUCTS_DIR ?=${HOME}/products +SALOME_ROOT_DIR ?=${PRODUCTS_DIR}/salome/Salome-V9_3_0-x86_64 +PREREQUISITES_ROOT_DIR ?=$(shell . ${SALOME_ROOT_DIR}/salome_prerequisites_root.sh; echo $${PREREQUISITES_ROOT_DIR}) +# PREREQUISITES_ROOT_DIR ?=${SALOME_ROOT_DIR}/prerequisites +## UTILISER LE PYTHON ET LE MODULE Six DE L'ENV SALOME +#On ne prend que les variable d'environement qui concernent python ds l'environement Salome pour éviter les effets de bords. +#En bash : saved_IFS=${IFS};IFS=',';for i in `grep 'PYTHONHOME' ${SALOME_ROOT_DIR}/salome_prerequisites.sh | tr -s '\n' ','`; do eval $i; done;IFS=saved_${IFS}; +#En GMake, ne fonctionne pas car le résultat du shell est multi-lignes : $(eval $(shell grep 'PYTHONHOME' ${SALOME_ROOT_DIR}/salome_prerequisites.sh | tr -s '\n' ';')) +#En GMake, ne fonctionne pas pour les variables de salome qui s'auto-référence : export PATH=${PYTHON_HOME}/bin:${PATH} +#En GMake, il faut donc substituer les = en := et supprimer les " +#$(foreach exp, $(shell grep 'PYTHONHOME' ${SALOME_ROOT_DIR}/salome_prerequisites.sh), $(eval $(exp)) ) +$(foreach exp, $(subst ",,$(subst =,:=,$(shell grep -e 'PYTHONHOME' -e 'Six' ${SALOME_ROOT_DIR}/salome_prerequisites.sh))), $(eval $(exp)) ) -cata_Vimmp_genere.py: cata_Vimmp.py - generateXSD.py -c ./$< +PYXB_ROOT_DIR=${PRODUCTS_DIR}/pyxb/install +PYXB ?=${PYXB_ROOT_DIR}/bin/pyxbgen +PYXB_PYTHONPATH ?=${PYXB_ROOT_DIR}/lib/python3.6/site-packages +export PYTHONPATH:=:${PYXB_PYTHONPATH}:${PYTHONPATH} -cata_gromacs_genere.py: cata_gromacs.py - generateXSD.py -c ./$< +#$(PYXB) -m $(basename $@) -u $? --location-prefix-rewrite http://chercheurs.edf.com/logiciels/vimmp= --write-for-customization \ +# L'utilisation de $? ne fonctionne pas si l'on modifie un seul catalogue le raccourcis ne redonne pas les fichiers non modifiés +# et pyxb détecte que le fichier a regénéré en dépend et qu'il n'est pas regénéré en même temps : $^ +# _genere.xsd_genere.py : +# $(PYXB) -m $(basename $@) -u $^ --write-for-customization +# xmllint --schema XMLSchema11_local.xsd --noout $^ + +# cata_Ambigu_1_Commun_genere.py: cata_Ambigu_1_Commun_genere.xsd +# cata_Ambigu_2_Commun_genere.py: cata_Ambigu_2_Commun_genere.xsd + + +#all: cata_Vimmp_genere.xsd cata_gromacs_genere.xsd all: cata_Vimmp_genere.py cata_gromacs_genere.py +cata_Vimmp_genere.xsd: cata_Vimmp.py + ./generateXSD.py -c ./$< + +cata_gromacs_genere.xsd: cata_gromacs.py + ./generateXSD.py -c ./$< + + cata_Vimmp_genere.py: cata_Vimmp_genere.xsd - (export PYTHONPATH=$(PYXB_PYTHONPATH):${PYTHONPATH} && \ - $(PYXB) -m $(basename $@) -u $^ --write-for-customization \ - ) - @echo "You may use : export PYTHONPATH=/local/PyXB-1.2.6.bin/lib/python2.7/site-packages/:${PYTHONPATH}" + @echo "--- PYTHONHOME --- : $${PYTHONHOME}" + @echo "--- PYTHONSTARTUP --- : $${PYTHONSTARTUP}" + @echo "--- PYTHON_INCLUDE --- : $${PYTHON_INCLUDE}" + @echo "--- PYTHONPATH --- : $${PYTHONPATH}" + @echo "--- PATH --- : $${PATH}" + @echo "--- LD_LIBRARY_PATH --- : $${LD_LIBRARY_PATH}" + $(PYXB) -m $(basename $@) -u $^ --write-for-customization + xmllint --schema XMLSchema11_local.xsd --noout $^ + @echo "You may use : export PYTHONPATH=${PYTHONPATH}" + +Cata_gromacs_genere.py: cata_Vimmp_genere.xsd cata_gromacs_genere.xsd + $(PYXB) -m $(basename $@) -u $^ --write-for-customization + for xsdfile in $^ + do + xmllint --schema XMLSchema11_local.xsd --noout $xsdfile + enddo + @echo "You may use : export PYTHONPATH=${PYTHONPATH}" -cata_gromacs_genere.py: cata_Vimmp_genere.xsd cata_gromacs_genere.xsd - (export PYTHONPATH=$(PYXB_PYTHONPATH):${PYTHONPATH} && \ - $(PYXB) -m $(basename $@) -u $^ --write-for-customization \ - ) - @echo "You may use : export PYTHONPATH=/local/PyXB-1.2.6.bin/lib/python2.7/site-packages/:${PYTHONPATH}" +xml: + @echo "Reminder: a .comm file is needed for this step" + ./generateXML.py -c cata_1.py cata_1_test_1.comm clean: - rm -f cata_Vimmp_genere.py raw/cata_Vimmp_genere.py cata_gromacs_genere.py raw/cata_gromacs_genere.py + rm -f *.pyc *~ + rm -f *_genere.py *_genere.xsd + rm -rf raw __pycache__ diff --git a/Vimmp/XMLSchema11_local.xsd b/Vimmp/XMLSchema11_local.xsd new file mode 100755 index 00000000..baa31a09 --- /dev/null +++ b/Vimmp/XMLSchema11_local.xsd @@ -0,0 +1,1950 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ]> + + + + + Part 1 version: structures.xsd (rec-20120405) + Part 2 version: datatypes.xsd (rec-20120405) + + + + + + The schema corresponding to this document is normative, + with respect to the syntactic constraints it expresses in the + XML Schema Definition Language. The documentation (within 'documentation' elements) + below, is not normative, but rather highlights important aspects of + the W3C Recommendation of which this is a part. + + See below (at the bottom of this document) for information about + the revision and namespace-versioning policy governing this + schema document. + + + + + + The simpleType element and all of its members are defined + towards the end of this schema document. + + + + + Get access to the xml: attribute groups for xml:lang + as declared on 'schema' and 'documentation' below + + + + + + + This type is extended by almost all schema types + to allow attributes from other namespaces to be + added to user schemas. + + + + + + + + + + + + This type is extended by all types which allow annotation + other than <schema> itself + + + + + + + + + + + + + + + + + + + + + + + + This group is for the + elements which occur freely at the top level of schemas. + All of their types are based on the "annotated" type by extension. + + + + + + + + + + + + This group is for the + elements which can self-redefine (see <redefine> below). + + + + + + + + + + + + A utility type, not for public use + + + + + + + + + + A utility type, not for public use + + + + + + + + + + A utility type, not for public use + + #all or (possibly empty) subset of {extension, restriction} + + + + + + + + + + + + + + + + A utility type, not for public use + + + + + + + + + + + + A utility type, not for public use + + #all or (possibly empty) subset of {extension, restriction, list, union} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + for maxOccurs + + + + + + + + + + + + + for all particles + + + + + + + + for element, group and attributeGroup, + which both define and reference + + + + + + + + 'complexType' uses this + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + This branch is short for + <complexContent> + <restriction base="xs:anyType"> + ... + </restriction> + </complexContent> + + + + + + + + + + + + + + + + Will be restricted to required or prohibited + + + + + + Not allowed if simpleContent child is chosen. + May be overridden by setting on complexContent child. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + This choice is added simply to + make this a valid restriction per the REC + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Overrides any setting on complexType parent. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + This choice is added simply to + make this a valid restriction per the REC + + + + + + + + + + + + + + + + + No typeDefParticle group reference + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + A utility type, not for public use + + #all or (possibly empty) subset of {substitution, extension, + restriction} + + + + + + + + + + + + + + + + + + + + + + + + The element element can be used either + at the top level to define an element-type binding globally, + or within a content model to either reference a globally-defined + element or type or declare an element-type binding locally. + The ref form is not allowed at the top level. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + This type is used for 'alternative' elements. + + + + + + + + + + + + + + + + + + group type for explicit groups, named top-level groups and + group references + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + group type for the three kinds of group + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + This choice with min/max is here to + avoid a pblm with the Elt:All/Choice/Seq + Particle derivation constraint + + + + + + + + + + + + + + + + + + + + + + + Only elements allowed inside + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + simple type for the value of the 'namespace' attr of + 'any' and 'anyAttribute' + + + + Value is + ##any - - any non-conflicting WFXML/attribute at all + + ##other - - any non-conflicting WFXML/attribute from + namespace other than targetNS + + ##local - - any unqualified non-conflicting WFXML/attribute + + one or - - any non-conflicting WFXML/attribute from + more URI the listed namespaces + references + (space separated) + + ##targetNamespace or ##local may appear in the above list, to + refer to the targetNamespace of the enclosing + schema or an absent targetNamespace respectively + + + + + A utility type, not for public use + + + + + + + + A utility type, not for public use + + + + + + + + + + + + + + + + + + A utility type, not for public use + + + + + + + + + + A utility type, not for public use + + + + + + + + + + + + + + + + + + + A utility type, not for public use + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + A subset of XPath expressions for use +in selectors + A utility type, not for public +use + + + + + + + + + + + + + + + + + + + + + A subset of XPath expressions for use +in fields + A utility type, not for public +use + + + + + + + + + + + + + + + + + + + + + + + + + The three kinds of identity constraints, all with + type of or derived from 'keybase'. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + A utility type, not for public use + + A public identifier, per ISO 8879 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + notations for use within schema documents + + + + + + + Not the real urType, but as close an approximation as we can + get in the XML representation + + + + + + + + + + In keeping with the XML Schema WG's standard versioning policy, + the material in this schema document will persist at the URI + http://www.w3.org/2012/04/XMLSchema.xsd. + + At the date of issue it can also be found at the URI + http://www.w3.org/2009/XMLSchema/XMLSchema.xsd. + + The schema document at that URI may however change in the future, + in order to remain compatible with the latest version of XSD + and its namespace. In other words, if XSD or the XML Schema + namespace change, the version of this document at + http://www.w3.org/2009/XMLSchema/XMLSchema.xsd will change accordingly; + the version at http://www.w3.org/2012/04/XMLSchema.xsd will not change. + + Previous dated (and unchanging) versions of this schema document + include: + + http://www.w3.org/2012/01/XMLSchema.xsd + (XSD 1.1 Proposed Recommendation) + + http://www.w3.org/2011/07/XMLSchema.xsd + (XSD 1.1 Candidate Recommendation) + + http://www.w3.org/2009/04/XMLSchema.xsd + (XSD 1.1 Candidate Recommendation) + + http://www.w3.org/2004/10/XMLSchema.xsd + (XSD 1.0 Recommendation, Second Edition) + + http://www.w3.org/2001/05/XMLSchema.xsd + (XSD 1.0 Recommendation, First Edition) + + + + + + + + + + + + A utility type, not for public use + + + + + + + + + + + + + + + + + + + + #all or (possibly empty) subset of {restriction, extension, union, list} + + + A utility type, not for public use + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Can be restricted to required or forbidden + + + + + + + + + + + + + + + + + Required at the top level + + + + + + + + + + + + + + + + + + Forbidden when nested + + + + + + + + + + + + + + + + + An abstract element, representing facets in general. + The facets defined by this spec are substitutable for + this element, and implementation-defined facets should + also name this as a substitution-group head. + + + + + + + + + + + + + + + + + base attribute and simpleType child are mutually + exclusive, but one or other is required + + + + + + + + + + + + + + + itemType attribute and simpleType child are mutually + exclusive, but one or other is required + + + + + + + + + + + + + + + + + memberTypes attribute must be non-empty or there must be + at least one simpleType child + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + In keeping with the XML Schema WG's standard versioning policy, + this schema document will persist at the URI + http://www.w3.org/2012/04/datatypes.xsd. + + At the date of issue it can also be found at the URI + http://www.w3.org/2009/XMLSchema/datatypes.xsd. + + The schema document at that URI may however change in the future, + in order to remain compatible with the latest version of XSD + and its namespace. In other words, if XSD or the XML Schema + namespace change, the version of this document at + http://www.w3.org/2009/XMLSchema/datatypes.xsd will change accordingly; + the version at http://www.w3.org/2012/04/datatypes.xsd will not change. + + Previous dated (and unchanging) versions of this schema document + include: + + http://www.w3.org/2012/01/datatypes.xsd + (XSD 1.1 Proposed Recommendation) + + http://www.w3.org/2011/07/datatypes.xsd + (XSD 1.1 Candidate Recommendation) + + http://www.w3.org/2009/04/datatypes.xsd + (XSD 1.1 Candidate Recommendation) + + http://www.w3.org/2004/10/datatypes.xsd + (XSD 1.0 Recommendation, Second Edition) + + http://www.w3.org/2001/05/datatypes.xsd + (XSD 1.0 Recommendation, First Edition) + + + + + + + diff --git a/Vimmp/xml.xsd b/Vimmp/xml.xsd new file mode 100644 index 00000000..bd291f3d --- /dev/null +++ b/Vimmp/xml.xsd @@ -0,0 +1,286 @@ + + + + + + +
+

About the XML namespace

+ +
+

+ This schema document describes the XML namespace, in a form + suitable for import by other schema documents. +

+

+ See + http://www.w3.org/XML/1998/namespace.html and + + http://www.w3.org/TR/REC-xml for information + about this namespace. +

+

+ Note that local names in this namespace are intended to be + defined only by the World Wide Web Consortium or its subgroups. + The names currently defined in this namespace are listed below. + They should not be used with conflicting semantics by any Working + Group, specification, or document instance. +

+

+ See further below in this document for more information about how to refer to this schema document from your own + XSD schema documents and about the + namespace-versioning policy governing this schema document. +

+
+
+
+
+ + + + +
+ +

lang (as an attribute name)

+

+ denotes an attribute whose value + is a language code for the natural language of the content of + any element; its value is inherited. This name is reserved + by virtue of its definition in the XML specification.

+ +
+
+

Notes

+

+ Attempting to install the relevant ISO 2- and 3-letter + codes as the enumerated possible values is probably never + going to be a realistic possibility. +

+

+ See BCP 47 at + http://www.rfc-editor.org/rfc/bcp/bcp47.txt + and the IANA language subtag registry at + + http://www.iana.org/assignments/language-subtag-registry + for further information. +

+

+ The union allows for the 'un-declaration' of xml:lang with + the empty string. +

+
+
+
+ + + + + + + + + +
+ + + + +
+ +

space (as an attribute name)

+

+ denotes an attribute whose + value is a keyword indicating what whitespace processing + discipline is intended for the content of the element; its + value is inherited. This name is reserved by virtue of its + definition in the XML specification.

+ +
+
+
+ + + + + + +
+ + + +
+ +

base (as an attribute name)

+

+ denotes an attribute whose value + provides a URI to be used as the base for interpreting any + relative URIs in the scope of the element on which it + appears; its value is inherited. This name is reserved + by virtue of its definition in the XML Base specification.

+ +

+ See http://www.w3.org/TR/xmlbase/ + for information about this attribute. +

+
+
+
+
+ + + + +
+ +

id (as an attribute name)

+

+ denotes an attribute whose value + should be interpreted as if declared to be of type ID. + This name is reserved by virtue of its definition in the + xml:id specification.

+ +

+ See http://www.w3.org/TR/xml-id/ + for information about this attribute. +

+
+
+
+
+ + + + + + + + + + +
+ +

Father (in any context at all)

+ +
+

+ denotes Jon Bosak, the chair of + the original XML Working Group. This name is reserved by + the following decision of the W3C XML Plenary and + XML Coordination groups: +

+
+

+ In appreciation for his vision, leadership and + dedication the W3C XML Plenary on this 10th day of + February, 2000, reserves for Jon Bosak in perpetuity + the XML name "xml:Father". +

+
+
+
+
+
+ + + +
+

About this schema document

+ +
+

+ This schema defines attributes and an attribute group suitable + for use by schemas wishing to allow xml:base, + xml:lang, xml:space or + xml:id attributes on elements they define. +

+

+ To enable this, such a schema must import this schema for + the XML namespace, e.g. as follows: +

+
+          <schema . . .>
+           . . .
+           <import namespace="http://www.w3.org/XML/1998/namespace"
+                      schemaLocation="http://www.w3.org/2001/xml.xsd"/>
+     
+

+ or +

+
+           <import namespace="http://www.w3.org/XML/1998/namespace"
+                      schemaLocation="http://www.w3.org/2009/01/xml.xsd"/>
+     
+

+ Subsequently, qualified reference to any of the attributes or the + group defined below will have the desired effect, e.g. +

+
+          <type . . .>
+           . . .
+           <attributeGroup ref="xml:specialAttrs"/>
+     
+

+ will define a type which will schema-validate an instance element + with any of those attributes. +

+
+
+
+
+ + + +
+

Versioning policy for this schema document

+
+

+ In keeping with the XML Schema WG's standard versioning + policy, this schema document will persist at + + http://www.w3.org/2009/01/xml.xsd. +

+

+ At the date of issue it can also be found at + + http://www.w3.org/2001/xml.xsd. +

+

+ The schema document at that URI may however change in the future, + in order to remain compatible with the latest version of XML + Schema itself, or with the XML namespace itself. In other words, + if the XML Schema or XML namespaces change, the version of this + document at + http://www.w3.org/2001/xml.xsd + + will change accordingly; the version at + + http://www.w3.org/2009/01/xml.xsd + + will not change. +

+

+ Previous dated (and unchanging) versions of this schema + document are at: +

+ +
+
+
+
+ +
-- 2.39.2