Bonjour,

Je souhaiterai "hériter" d' un complex type définie dans un namespace GMD (ce xsd vient d'un norme iso don non modifiable) . J'ai donc utilisé le tag de "restriction" dans un autre xsd et un autre namespace "MYO".

J'ai plusieurs soucis:
1- Mon nouveau xsd MYO.xsd n'est valide que si je mets elementFormDefault à "unqualified" dans mes deux xsd. Or je ne suis pas sensé modifier le fichier GMD.xsd. J'ai dans un premier temps fait un copier coller du type dans MYO.xsd est ça ne valide pas.

erreurs :
-There is not a complete functional mapping between the particles
-Error for type 'MD_Metadata_Common_Type'. The particle of the type is not a valid restriction of the particle of the base.


2- Le complex type iso est défini ainsi : le name space est GMD

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<xs:complexType name="MD_Metadata_Type">
		<xs:annotation>
			<xs:documentation>Information about the metadata</xs:documentation>
		</xs:annotation>
		<xs:complexContent>
			<xs:extension base="gco:AbstractObject_Type">
				<xs:sequence>
					<xs:element name="fileIdentifier" type="gco:CharacterString_PropertyType" minOccurs="0"/>
					<xs:element name="language" type="gco:CharacterString_PropertyType" minOccurs="0"/>
					<xs:element name="characterSet" type="gmd:MD_CharacterSetCode_PropertyType" minOccurs="0"/>
					<xs:element name="parentIdentifier" type="gco:CharacterString_PropertyType" minOccurs="0"/>
					<xs:element name="hierarchyLevel" type="gmd:MD_ScopeCode_PropertyType" minOccurs="0" maxOccurs="unbounded"/>
					<xs:element name="hierarchyLevelName" type="gco:CharacterString_PropertyType" minOccurs="0" maxOccurs="unbounded"/>
					<xs:element name="contact" type="gmd:CI_ResponsibleParty_PropertyType" maxOccurs="unbounded"/>
					<xs:element name="dateStamp" type="gco:Date_PropertyType"/>
					<xs:element name="metadataStandardName" type="gco:CharacterString_PropertyType" minOccurs="0"/>
					<xs:element name="metadataStandardVersion" type="gco:CharacterString_PropertyType" minOccurs="0"/>
					<xs:element name="dataSetURI" type="gco:CharacterString_PropertyType" minOccurs="0"/>
					<xs:element name="locale" type="gmd:PT_Locale_PropertyType" minOccurs="0" maxOccurs="unbounded"/>
					<xs:element name="spatialRepresentationInfo" type="gmd:MD_SpatialRepresentation_PropertyType" minOccurs="0" maxOccurs="unbounded"/>
					<xs:element name="referenceSystemInfo" type="gmd:MD_ReferenceSystem_PropertyType" minOccurs="0" maxOccurs="unbounded"/>
					<xs:element name="metadataExtensionInfo" type="gmd:MD_MetadataExtensionInformation_PropertyType" minOccurs="0" maxOccurs="unbounded"/>
					<xs:element name="identificationInfo" type="gmd:MD_Identification_PropertyType" maxOccurs="unbounded"/>
					<xs:element name="contentInfo" type="gmd:MD_ContentInformation_PropertyType" minOccurs="0" maxOccurs="unbounded"/>
					<xs:element name="distributionInfo" type="gmd:MD_Distribution_PropertyType" minOccurs="0"/>
					<xs:element name="dataQualityInfo" type="gmd:DQ_DataQuality_PropertyType" minOccurs="0" maxOccurs="unbounded"/>
					<xs:element name="portrayalCatalogueInfo" type="gmd:MD_PortrayalCatalogueReference_PropertyType" minOccurs="0" maxOccurs="unbounded"/>
					<xs:element name="metadataConstraints" type="gmd:MD_Constraints_PropertyType" minOccurs="0" maxOccurs="unbounded"/>
					<xs:element name="applicationSchemaInfo" type="gmd:MD_ApplicationSchemaInformation_PropertyType" minOccurs="0" maxOccurs="unbounded"/>
					<xs:element name="metadataMaintenance" type="gmd:MD_MaintenanceInformation_PropertyType" minOccurs="0"/>
					<xs:element name="series" type="gmd:DS_Aggregate_PropertyType" minOccurs="0" maxOccurs="unbounded"/>
					<xs:element name="describes" type="gmd:DS_DataSet_PropertyType" minOccurs="0" maxOccurs="unbounded"/>
					<xs:element name="propertyType" type="gco:ObjectReference_PropertyType" minOccurs="0" maxOccurs="unbounded"/>
					<xs:element name="featureType" type="gco:ObjectReference_PropertyType" minOccurs="0" maxOccurs="unbounded"/>
					<xs:element name="featureAttribute" type="gco:ObjectReference_PropertyType" minOccurs="0" maxOccurs="unbounded"/>
				</xs:sequence>
			</xs:extension>
		</xs:complexContent>
	</xs:complexType>
mon complex type est défini ainsi:

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<xs:complexType name="Custom_MD_Metadata_Type">
		<xs:annotation>
			<xs:documentation>Information about the metadata</xs:documentation>
		</xs:annotation>
		<xs:complexContent>
			<xs:extension base="gmd:MD_Metadata_Type">
				<xs:sequence>
					<xs:element name="fileIdentifier" type="gco:CharacterString_PropertyType" minOccurs="0"/>
					<xs:element name="language" type="gco:CharacterString_PropertyType" minOccurs="0"/>
					<xs:element name="characterSet" type="gmd:MD_CharacterSetCode_PropertyType" minOccurs="0"/>
					<xs:element name="parentIdentifier" type="gco:CharacterString_PropertyType" minOccurs="0"/>
					<xs:element name="hierarchyLevel" type="gmd:MD_ScopeCode_PropertyType" minOccurs="0" maxOccurs="unbounded"/>
					<xs:element name="hierarchyLevelName" type="gco:CharacterString_PropertyType" minOccurs="0" maxOccurs="unbounded"/>
					<xs:element name="contact" type="gmd:CI_ResponsibleParty_PropertyType" maxOccurs="unbounded"/>
					<xs:element name="dateStamp" type="gco:Date_PropertyType"/>
					<xs:element name="metadataStandardName" type="gco:CharacterString_PropertyType" minOccurs="0"/>
					<xs:element name="metadataStandardVersion" type="gco:CharacterString_PropertyType" minOccurs="0"/>
					<xs:element name="dataSetURI" type="gco:CharacterString_PropertyType" minOccurs="0"/>
					<xs:element name="locale" type="gmd:PT_Locale_PropertyType" minOccurs="0" maxOccurs="unbounded"/>
					<xs:element name="spatialRepresentationInfo" type="gmd:MD_SpatialRepresentation_PropertyType" minOccurs="0" maxOccurs="unbounded"/>
					<xs:element name="referenceSystemInfo" type="gmd:MD_ReferenceSystem_PropertyType" minOccurs="0" maxOccurs="unbounded"/>
					<xs:element name="metadataExtensionInfo" type="gmd:MD_MetadataExtensionInformation_PropertyType" minOccurs="0" maxOccurs="unbounded"/>
					<xs:element name="identificationInfo" type="gmd:MD_Identification_PropertyType" maxOccurs="unbounded"/>
					<xs:element name="contentInfo" type="gmd:MD_ContentInformation_PropertyType" minOccurs="0" maxOccurs="unbounded"/>
					<xs:element name="distributionInfo" type="gmd:MD_Distribution_PropertyType" minOccurs="0"/>
					<xs:element name="dataQualityInfo" type="gmd:DQ_DataQuality_PropertyType" minOccurs="0" maxOccurs="unbounded"/>
					<xs:element name="portrayalCatalogueInfo" type="gmd:MD_PortrayalCatalogueReference_PropertyType" minOccurs="0" maxOccurs="unbounded"/>
					<xs:element name="metadataConstraints" type="gmd:MD_Constraints_PropertyType" minOccurs="0" maxOccurs="unbounded"/>
					<xs:element name="applicationSchemaInfo" type="gmd:MD_ApplicationSchemaInformation_PropertyType" minOccurs="0" maxOccurs="unbounded"/>
					<xs:element name="metadataMaintenance" type="gmd:MD_MaintenanceInformation_PropertyType" minOccurs="0"/>
					<xs:element name="series" type="gmd:DS_Aggregate_PropertyType" minOccurs="0" maxOccurs="unbounded"/>
					<xs:element name="describes" type="gmd:DS_DataSet_PropertyType" minOccurs="0" maxOccurs="unbounded"/>
					<xs:element name="propertyType" type="gco:ObjectReference_PropertyType" minOccurs="0" maxOccurs="unbounded"/>
					<xs:element name="featureType" type="gco:ObjectReference_PropertyType" minOccurs="0" maxOccurs="unbounded"/>
					<xs:element name="featureAttribute" type="gco:ObjectReference_PropertyType" minOccurs="0" maxOccurs="unbounded"/>
				</xs:sequence>
			</xs:extension>
		</xs:complexContent>
	</xs:complexType>
Quand j'essaie de modifier le type "gmd : DS_DataSet_PropertyType" par exemple d'un des éléments par un sous type "myo : Sous_DS_DataSet_PropertyType" mon xsd n'est plus valide. Mêmes erreurs qu'en 1.


Ce problème soulève beaucoup de question pour moi.
- Est- ce que ce que je cherche à faire est faisable en xsd ?
- Peut-on vraiment faire de l'héritage au sens objet avec du xsd ?
- Si oui quelles sont les limitations ?

Si quelqu'un pouvait m'éclairer ou me montrer mon erreur? Je peux joindre les xsd si quelqu'un le souhaite.

Merci d'avance

Zippo29