-
Key: XTCE13-127
-
Status: closed
-
Source: Space Applications Services ( Nicolae Mihalache)
-
Summary:
In addition to the clarity issues highlighted by
XTCE13-30, the current definition of StringDataEncoding has a major drawback for variable strings: the VariableStringType enforces one of DynamicValueType or DiscreteLookupListType.However the size of the string can be very well determined by the other two methods LeadingSize or TerminationChar. Usage of LeadingSize/TerminationChar in combination with the enforced DynamicValueType/DiscreteLookupListType does not make sense when the string fills completely the allocated buffer and so the size of the string determines the size of the buffer.
In my opinion having a variable size buffer with a variable string inside that buffer is much less common (never heard of it in fact) than having a fixed size buffer with a variable string inside or a variable string with no buffer (the buffer is the string).
Suggest to make the DynamicValueType/DiscreteLookupListType optional.
-
Reported: XTCE 1.2 — Fri, 30 Apr 2021 07:34 GMT
-
Disposition: Resolved — XTCE 1.3
-
Disposition Summary:
Refactor optional elements in StringDataEncoding content
There does appear to be a combination in the issue that XTCE 1.2 does not well support. To address this, some previous required elements were split into two choice groupings in the schema with additional annotation.
There is a separate, but very similar, type definition each for the TM and TC side of the schema. Each needs to be updated.
Existing VariableStringType definition:
<complexType name="VariableStringType">
<annotation>
<documentation xml:lang="en">Describe a variable string whose length may change between samples.</documentation>
</annotation>
<sequence>
<choice>
<element name="DynamicValue" type="xtce:DynamicValueType">
<annotation>
<documentation xml:lang="en">Determine the container size in bits by interrogating an instance of a parameter.</documentation>
</annotation>
</element>
<element name="DiscreteLookupList" type="xtce:DiscreteLookupListType">
<annotation>
<documentation xml:lang="en">Determine the container size in bits by interrogating an instance of a parameter and selecting a specified value based on tests of the value of that parameter.</documentation>
</annotation>
</element>
</choice>
<element name="LeadingSize" type="xtce:LeadingSizeType" minOccurs="0">
<annotation>
<documentation xml:lang="en">In some string implementations, the size of the string contents (not the memory allocation size) is determined by a leading numeric value. This is sometimes referred to as Pascal strings. If a LeadingSize is specified, then the TerminationChar element does not have a functional meaning.</documentation>
</annotation>
</element>
<element name="TerminationChar" type="hexBinary" default="00" minOccurs="0">
<annotation>
<documentation xml:lang="en">The termination character that represents the end of the string contents. For C and most strings, this is null (00), which is the default.</documentation>
</annotation>
</element>
</sequence>
<attribute name="maxSizeInBits" type="xtce:PositiveLongType" use="required">
<annotation>
<documentation xml:lang="en">The upper bound of the size of this string data type so that the implementation can reserve/allocate enough memory to capture all reported instances of the string.</documentation>
</annotation>
</attribute>
</complexType>Update the VariableStringType with the following content:
<complexType name="VariableStringType">
<annotation>
<documentation xml:lang="en">Describe a variable string whose length may change between samples.</documentation>
</annotation>
<sequence>
<choice minOccurs="0">
<annotation>
<documentation>Select the method by which the container entry list allocation in bits will be observed while encoding or decoding the container fields.</documentation>
</annotation>
<element name="DynamicValue" type="xtce:DynamicValueType">
<annotation>
<documentation xml:lang="en">Determine the container size in bits by interrogating an instance of a parameter.</documentation>
</annotation>
</element>
<element name="DiscreteLookupList" type="xtce:DiscreteLookupListType">
<annotation>
<documentation xml:lang="en">Determine the container size in bits by interrogating an instance of a parameter and selecting a specified value based on tests of the value of that parameter.</documentation>
</annotation>
</element>
</choice>
<choice>
<annotation>
<documentation>Select the method by which the string content is encoded or decoded within the container entry list allocation of bits.</documentation>
</annotation>
<element name="LeadingSize" type="xtce:LeadingSizeType">
<annotation>
<documentation xml:lang="en">In some string implementations, the size of the string contents (not the memory allocation size) is determined by a leading numeric value. This is sometimes referred to as Pascal strings. If a LeadingSize is specified, then the TerminationChar element does not have a functional meaning.</documentation>
</annotation>
</element>
<element name="TerminationChar" type="hexBinary" default="00">
<annotation>
<documentation xml:lang="en">The termination character that represents the end of the string contents. For C and most strings, this is null (00), which is the default.</documentation>
</annotation>
</element>
</choice>
</sequence>
<attribute name="maxSizeInBits" type="xtce:PositiveLongType" use="required">
<annotation>
<documentation xml:lang="en">The upper bound of the size of this string data type so that the implementation can reserve/allocate enough memory to capture all reported instances of the string.</documentation>
</annotation>
</attribute>
</complexType>Then a similar change needs to be made to the existing ArgumentVariableStringType:
<complexType name="ArgumentVariableStringType">
<annotation>
<documentation>Identical to VariableStringType but supports argument instance references.</documentation>
</annotation>
<sequence>
<choice>
<element name="DynamicValue" type="xtce:ArgumentDynamicValueType">
<annotation>
<documentation xml:lang="en">Determine the container size in bits by interrogating an instance of a parameter or argument.</documentation>
</annotation>
</element>
<element name="DiscreteLookupList" type="xtce:ArgumentDiscreteLookupListType">
<annotation>
<documentation xml:lang="en">Determine the container size in bits by interrogating an instance of a parameter or argument and selecting a specified value based on tests of the value of that parameter or argument.</documentation>
</annotation>
</element>
</choice>
<element name="LeadingSize" type="xtce:LeadingSizeType" minOccurs="0">
<annotation>
<documentation xml:lang="en">In some string implementations, the size of the string contents (not the memory allocation size) is determined by a leading numeric value. This is sometimes referred to as Pascal strings. If a LeadingSize is specified, then the TerminationChar element does not have a functional meaning.</documentation>
</annotation>
</element>
<element name="TerminationChar" type="hexBinary" default="00" minOccurs="0">
<annotation>
<documentation xml:lang="en">The termination character that represents the end of the string contents. For C and most strings, this is null (00), which is the default.</documentation>
</annotation>
</element>
</sequence>
<attribute name="maxSizeInBits" type="xtce:PositiveLongType" use="required">
<annotation>
<documentation xml:lang="en">The upper bound of the size of this string data type so that the implementation can reserve/allocate enough memory to capture all reported instances of the string.</documentation>
</annotation>
</attribute>
</complexType>Replace with the following type definition:
<complexType name="ArgumentVariableStringType">
<annotation>
<documentation>Identical to VariableStringType but supports argument instance references.</documentation>
</annotation>
<sequence>
<choice minOccurs="0">
<annotation>
<documentation>Select the method by which the container entry list allocation in bits will be observed while encoding or decoding the container fields.</documentation>
</annotation>
<element name="DynamicValue" type="xtce:ArgumentDynamicValueType">
<annotation>
<documentation xml:lang="en">Determine the container size in bits by interrogating an instance of a parameter or argument.</documentation>
</annotation>
</element>
<element name="DiscreteLookupList" type="xtce:ArgumentDiscreteLookupListType">
<annotation>
<documentation xml:lang="en">Determine the container size in bits by interrogating an instance of a parameter or argument and selecting a specified value based on tests of the value of that parameter or argument.</documentation>
</annotation>
</element>
</choice>
<choice>
<annotation>
<documentation>Select the method by which the string content is encoded or decoded within the container entry list allocation of bits.</documentation>
</annotation>
<element name="LeadingSize" type="xtce:LeadingSizeType">
<annotation>
<documentation xml:lang="en">In some string implementations, the size of the string contents (not the memory allocation size) is determined by a leading numeric value. This is sometimes referred to as Pascal strings. If a LeadingSize is specified, then the TerminationChar element does not have a functional meaning.</documentation>
</annotation>
</element>
<element name="TerminationChar" type="hexBinary" default="00">
<annotation>
<documentation xml:lang="en">The termination character that represents the end of the string contents. For C and most strings, this is null (00), which is the default.</documentation>
</annotation>
</element>
</choice>
</sequence>
<attribute name="maxSizeInBits" type="xtce:PositiveLongType" use="required">
<annotation>
<documentation xml:lang="en">The upper bound of the size of this string data type so that the implementation can reserve/allocate enough memory to capture all reported instances of the string.</documentation>
</annotation>
</attribute>
</complexType>See attached image from XMLSpy for context.
-
Updated: Tue, 1 Jul 2025 15:05 GMT
-
Attachments:
- variable_string_type.png 42 kB (image/png)
XTCE13 — Variable string size specification enforces one of DynamicValueType or DiscreteLookupListType
- Key: XTCE13-127
- OMG Task Force: XML Telemetric & Command Exchange Format 1.3 (XTCE) RTF