Skip to content

Require that dfdlx:repType references a global simple type definition#1075

Merged
stevedlawrence merged 1 commit intoapache:mainfrom
stevedlawrence:daffodil-2211-require-derived-type
Aug 29, 2023
Merged

Require that dfdlx:repType references a global simple type definition#1075
stevedlawrence merged 1 commit intoapache:mainfrom
stevedlawrence:daffodil-2211-require-derived-type

Conversation

@stevedlawrence
Copy link
Member

Primitive types do not carry any DFDL properties and so do not make for very good repTypes. To support primitive types as a repType, all DFDL proprties would need to come from the general format, which would only make sense if a few specific cases.

Instead, we simply disallow primitive repTypes, instead requiring that repType be a QName to a simple global type definition, which DFDL properties can be put.

This creates a new function to create a helpful diagnostic when it is detected that a repType references a primitive type. Additionally, dfdl:prefixLengthType already has this restriction, and is modified to use this new helper function.

Deprecation/Compatibility:

dfdlx:repType can no longer reference primitive types (e.g. xs:int). Instead, a global simple type definition should be created with that has a base of the primitive type.

DAFFODIL-2211

Primitive types do not carry any DFDL properties and so do not make for
very good repTypes. To support primitive types as a repType, all DFDL
proprties would need to come from the general format, which would only
make sense if a few specific cases.

Instead, we simply disallow primitive repTypes, instead requiring
that repType be a QName to a simple global type definition, which DFDL
properties can be put.

This creates a new function to create a helpful diagnostic when it is
detected that a repType references a primitive type. Additionally,
dfdl:prefixLengthType already has this restriction, and is modified to
use this new helper function.

Deprecation/Compatibility:

dfdlx:repType can no longer reference primitive types (e.g. xs:int).
Instead, a global simple type definition should be created with that has
a base of the primitive type.

DAFFODIL-2211
Copy link
Contributor

@mbeckerle mbeckerle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

Copy link
Contributor

@tuxji tuxji left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

@stevedlawrence stevedlawrence merged commit 19eb2a3 into apache:main Aug 29, 2023
@stevedlawrence stevedlawrence deleted the daffodil-2211-require-derived-type branch August 29, 2023 17:49
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