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

ID | Project | Category | View Status | Date Submitted | Last Update
0007982 | Part 09: Using XML with TTCN-3 | Technical | public | 18-09-2020 10:59 | 17-12-2020 12:00

Reporter | Wolfgang Seka |
Assigned To | Gyorgy Rethy |
Priority | normal | Severity | minor | Reproducibility | have not tried
Status | closed | Resolution | fixed |
Platform |  | OS |  | OS Version |
Product Version | 4.11.1 (published 2020-05) |
Target Version | 4.12.1 (ongoing) | Fixed in Version | 4.12.1 (ongoing) |
Clause Reference(s) | Part 9
For STF discussion |
Source (company - Author) | MCC160 - Wolfgang

Summary | 0007982: Ambiguous decoding of xml

Description

There are XSD definitions which may cause ambiguities at decoding:
E.g. RFC4745 defines
<xs:complexType name="manyType">
<xs:complexContent>
<xs:restriction base="xs:anyType">
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element name="except" type="cp:exceptType"/>
<xs:any namespace="##other"
minOccurs="0" processContents="lax"/>
</xs:choice>
<xs:attribute name="domain"
use="optional" type="xs:string"/>
</xs:restriction>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="exceptType">
<xs:attribute name="domain" type="xs:string" use="optional"/>
<xs:attribute name="id" type="xs:anyURI" use="optional"/>
</xs:complexType>
The corresponding TTCN-3 definition are
type record ExceptType {
XSD.String domain optional,
XSD.AnyURI id optional
}
type record ManyType
{
XSD.String domain optional,
record of union {
ExceptType except_,
record length(0 .. 1) of XSD.String elem_list
} choice_list
};
This results in ambiguities as e.g.
{ domain:="...",
choice_list:={elem_list:={} }
}
and
{ domain:="...",
choice_list:={}
}
result in the same xml-value, but in TTCN-3 these are distinct values.
=> Clarification is needed to ensure tool compatibility.

Steps To Reproduce |
Additional Information |
Tags | No tags attached.
Relationships |
Attached Files | CR7982.docx (51,519) 08-12-2020 14:22 http://oldforge.etsi.org/mantis/file_download.php?file_id=3975&type=bug

Issue History
Date Modified | Username | Field | Change
18-09-2020 10:59 | Wolfgang Seka | New Issue |
21-09-2020 15:51 | Jacob Wieland - Spirent | Note Added: 0015755 |
05-10-2020 08:19 | Jens Grabowski | Assigned To | => Tomas Urban
05-10-2020 08:19 | Jens Grabowski | Status | new => assigned
05-10-2020 08:20 | Jens Grabowski | Project | TTCN-3 Change Requests => Part 09: Using XML with TTCN-3
07-10-2020 08:52 | Tomas Urban | Note Added: 0015763 |
08-10-2020 12:00 | Wolfgang Seka | Note Added: 0015778 |
09-10-2020 10:25 | Jens Grabowski | Note Added: 0015789 |
09-10-2020 10:25 | Jens Grabowski | Assigned To | Tomas Urban => Jens Grabowski
08-12-2020 14:22 | Jens Grabowski | File Added: CR7982.docx |
08-12-2020 14:24 | Jens Grabowski | Note Added: 0015814 |
08-12-2020 14:24 | Jens Grabowski | Assigned To | Jens Grabowski => Tomas Urban
08-12-2020 14:25 | Jens Grabowski | Status | assigned => confirmed
09-12-2020 07:40 | Tomas Urban | Note Added: 0015818 |
09-12-2020 07:40 | Tomas Urban | Status | confirmed => resolved
09-12-2020 07:40 | Tomas Urban | Resolution | open => fixed
09-12-2020 07:40 | Tomas Urban | Assigned To | Tomas Urban => Gyorgy Rethy
17-12-2020 12:00 | Gyorgy Rethy | Note Added: 0015879 |
17-12-2020 12:00 | Gyorgy Rethy | Status | resolved => closed
17-12-2020 12:00 | Gyorgy Rethy | Product Version | => 4.11.1 (published 2020-05)
17-12-2020 12:00 | Gyorgy Rethy | Fixed in Version | => 4.12.1 (ongoing)
17-12-2020 12:00 | Gyorgy Rethy | Target Version | => 4.12.1 (ongoing)

Notes

(0015755)
Jacob Wieland - Spirent
21-09-2020 15:51

the ambiguity exists already on the XSD level, as it is not clear if the empty content is the empty list of outer-choice or an arbitary amount of outer-choice instances that always contain an empty inner choice.
As all are valid interpretations of the empty content, it is unclear why the decoder should prefer one over the others.
Thus, all correct interpretations that the codec can give back should be acceptable.
A template matching all the empty-values could be defined using the AdvancedMatching @dynamic template matching mechanism.
Making the XSD unambiguous by declaring the inner choice with minOccurs="1" would also be a simple solution, if available.

(0015763)
Tomas Urban
07-10-2020 08:52

I think that one solution to the problem is that we could introduce a canonical form of decoding. In this form, the decoded value would have the smallest possible amount of elements that still properly represent the encoded value. The canonical decoding form would be activated in a similar fashion as substitution (i.e. on the tool level).
We would have to think carefully how to specify the rules. Some examples:
Places that can be simplified:
- optional fields of records (empty valus are transformed to omitted ones)
- elements of record of (empty values are removed from the record of)
Values that could be considered empty:
- Empty "record of" value
- Union value if the selected option is an empty value

(0015778)
Wolfgang Seka
08-10-2020 12:00

Tomas' approach sounds reasonable even though I don't know the technical impact for tool development.

(0015789)
Jens Grabowski
09-10-2020 10:25

STF decision: For the moment a note should be added that ambiguities in the XSD source are not resolved on TTCN-3 level.

(0015814)
Jens Grabowski
08-12-2020 14:24

Tomas, I'm not sure I put the note in the appropriate section. Check and move if necessary.

(0015818)
Tomas Urban
09-12-2020 07:40

The note seems to be in the correct location. The proposal is therefore ready to be included in the next version of the standard.

(0015879)
Gyorgy Rethy
17-12-2020 12:00

Implemented in draft 4.11.2