Skip to content

Conversation

@martinv13
Copy link
Collaborator

@martinv13 martinv13 commented Apr 25, 2025

Fix a bug where a base type for a complex type with simple content is itself a complex type.

Example which raised the issue:

<xs:complexType name="ref">
	<xs:simpleContent>
		<xs:extension base="xs:string"><!-- pour le libelle, obligatoire s'il est présent en base de données -->
			<xs:attribute name="ref-type" type="typeRef" /><!-- obligatoire si ref unique, pas a fournir si liste de référence (type name=refs) -->
			<xs:attribute name="ref-id" type="xs:string" use="required" />
			<xs:attribute name="lib-court" type="xs:string"/>
			<xs:attribute name="lib-specifique" type="xs:string" />
		</xs:extension>
	</xs:simpleContent>
</xs:complexType>
<xs:element name="etat-usage" ><!-- ref-type=type-usage -->
	<xs:complexType>
		<xs:simpleContent>
			<xs:extension base="ref">
				<xs:attribute name="provisoire" type="xs:boolean" />
			</xs:extension>
		</xs:simpleContent>
	</xs:complexType>
</xs:element>

Also had to shorten the unique constraint name for xml2db_record_hash (kind of a quick fixed, has the broader issue of long table/columns/constraints names needs to be fixed anyways).

Solves #31

@martinv13 martinv13 merged commit 76269d4 into main Apr 28, 2025
11 checks passed
@martinv13 martinv13 deleted the fix/complex_base_type branch April 28, 2025 08:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants