TOO_MANY_DATA_ELEMENTS when repeating a segment #494
-
I have created several schema files for EDIFACT and when repeating a composite type, I am faced with an error of "TOO_MANY_DATA_ELEMENTS" I am repeating a composite C212 within a PIA segment; the first occurrence works correctly but subsequent occurrences result in the stated error Here is the schema entry for the segment:
It does not matter whether I include minOccurs or maxOccurs, it only accepts a single instance of the composite C212. This is just an example, I have had issues with similar composites in other schema files the composite C212 is as follows
The elements E1131 and E3055 are not currently used in this composite but have been added to the schema to ensure completeness. E7140 is a basic string:
and E7143 is a string with enumeration. I have anonymised the values here. these appear to evaluate correctly, and each is used a maximum of one time in the generated file:
Have I overlooked some aspect of the schema here in order to allow repeated occurrences within a segment? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 5 replies
-
Hi @xander-proact , it seems like what you have in your schema should work. Do you have a sample |
Beta Was this translation helpful? Give feedback.
-
While upgrading the specification to Syntax Version 4 does indeed fix this issue, due to real-world limitations with third party service providers it's not as straightforward as just upgrading the specification. I have managed to validate Syntax Version 3 successfully by simply repeating the offending composite element in the schema XML file the required number of times, so each is technically a separate element within the segment (treating the repetitions as PIA02, PIA03, PIA04 etc):
Marked the response to change the syntax version as solution as this is technically the correct procedure; closing issue |
Beta Was this translation helpful? Give feedback.
The error
TOO_MANY_DATA_ELEMENTS
is because the validator "sees" element PIA03, but what you want are multiple occurrences of PIA02. The repeater*
should do that.