ETSI's Bug Tracker - Part 09: Using XML with TTCN-3
View Issue Details

ID | Project | Category | View Status | Date Submitted | Last Update
0007210 | Part 09: Using XML with TTCN-3 | Technical | public | 29-10-2015 11:09 | 04-12-2015 15:46

Reporter | Gyorgy Rethy |
Assigned To | Gyorgy Rethy |
Priority | normal | Severity | minor | Reproducibility | have not tried
Status | closed | Resolution | fixed |
Platform |  | OS |  | OS Version |
Product Version | v4.6.1 (published 2015-06) |
Target Version | v4.7.1 (published 2016-07) | Fixed in Version | v4.7.1 (published 2016-07) |
Clause Reference(s) | 7.6.6.6 and B.3.21
For STF discussion |
Source (company - Author) | L.M.Ericsson

Summary | 0007210: How to decode an empty element when an optional sequence includes optional elements only

Description

The XSD element below :
<xsd:element name="optionals_in_optional">
<xsd:complexType>
<xsd:sequence minOccurs="0">
<xsd:element name="elem1" type="xsd:string" minOccurs="0"/>
<xsd:element name="elem2" type="xsd:integer" minOccurs="0"/>
<xsd:element name="elem3" type="xsd:decimal" minOccurs="0"/>
<xsd:element name="elem4" type="xsd:dateTime" minOccurs="0"/>
<xsd:element name="elem5" type="xsd:duration" minOccurs="0"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
will be translated to TTCN-3 as:
type record Optionals_in_optional
{
record {
XSD.String elem1 optional,
XSD.Integer elem2 optional,
XSD.Decimal elem3 optional,
XSD.DateTime elem4 optional,
XSD.Duration elem5 optional
} sequence optional
}
with {
variant "name as uncapitalized";
variant "element";
variant (sequence) "untagged";
};
where the 'sequence' name of the record shall not be present in the encoded XML value.
This is not the problem at encoding, both
template Optionals_in_optional t_optionals1 := { sequence := omit }
and
template Optionals_in_optional t_optionals2 := {
sequence := {
elem1 := omit,
elem2 := omit,
elem3 := omit,
elem4 := omit,
elem5 := omit
}
}
will be encoded as an empty <optionals_in_optional></optionals_in_optional> element.
However, it is NOT SPECIFIED, how the above incoming element shall be decoded into TTCN-3. Therefore the user needs to define a template list containing both templates above to be sure that the incoming empty element will match. This is cumbersome and superflouos.
Proposed solution: it is proposed to specify that this specific case shall be decoded to the value { sequence := omit }; this is the shortest and thus more user friendly solution.
Note: it could cause backward incompatibility if code is written to tool-specific decoding, and causes no backward compatibility for code written to ba standard-compliant.

Steps To Reproduce |
Additional Information |
Tags | No tags attached.
Relationships |
Attached Files | CR7210_resolution_v1.docx (63,553) 29-10-2015 11:54 http://oldforge.etsi.org/mantis/file_download.php?file_id=3332&type=bug CR7210_resolution_v2.docx (65,389) 04-11-2015 11:11 http://oldforge.etsi.org/mantis/file_download.php?file_id=3357&type=bug

Issue History
Date Modified | Username | Field | Change
29-10-2015 11:09 | Gyorgy Rethy | New Issue |
29-10-2015 11:37 | Gyorgy Rethy | Description Updated | bug_revision_view_page.php?rev_id=194#r194
29-10-2015 11:45 | Gyorgy Rethy | Description Updated | bug_revision_view_page.php?rev_id=195#r195
29-10-2015 11:54 | Gyorgy Rethy | File Added: CR7210_resolution_v1.docx |
29-10-2015 11:55 | Gyorgy Rethy | Description Updated | bug_revision_view_page.php?rev_id=196#r196
03-11-2015 16:49 | Gyorgy Rethy | Assigned To | => Axel Rennoch
03-11-2015 16:49 | Gyorgy Rethy | Status | new => assigned
03-11-2015 16:50 | Gyorgy Rethy | Note Added: 0013481 |
04-11-2015 11:11 | Axel Rennoch | File Added: CR7210_resolution_v2.docx |
04-11-2015 11:13 | Axel Rennoch | Note Added: 0013484 |
04-11-2015 11:13 | Axel Rennoch | Assigned To | Axel Rennoch => Gyorgy Rethy
04-11-2015 11:13 | Axel Rennoch | Status | assigned => confirmed
04-11-2015 13:56 | Gyorgy Rethy | Status | confirmed => resolved
04-11-2015 13:56 | Gyorgy Rethy | Fixed in Version | => v4.7.1 (published 2016-07)
04-11-2015 13:56 | Gyorgy Rethy | Resolution | open => fixed
04-11-2015 14:05 | Gyorgy Rethy | Product Version | => v4.6.1 (published 2015-06)
04-11-2015 14:05 | Gyorgy Rethy | Target Version | => v4.7.1 (published 2016-07)
04-12-2015 15:46 | Gyorgy Rethy | Note Added: 0013560 |
04-12-2015 15:46 | Gyorgy Rethy | Status | resolved => closed

Notes

(0013481)
Gyorgy Rethy
03-11-2015 16:50

STF discussion: agreed in pronciple. Review proposed solution.

(0013484)
Axel Rennoch
04-11-2015 11:13

Just some minor formatting issues solved in resolution_v2.

(0013560)
Gyorgy Rethy
04-12-2015 15:46

Added to draft V4.6.3