Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC: Mapping of embedded <element><simpleType><restriction> with min-/maxOccurs

Mapping of embedded <element><simpleType&​gt;<restriction> with min-/maxOccurs 22 Jun 2011 16:10 #7763

Hi,

I have a question how to map a XSD Definition of the latest RAN5 delivery to TTCN-3 according to Part 9 of the standard:

In CDIVN.xsd of the latest RAN5 delivery it's defined:
<!--
  COMMUNICATION DIVERSION NOTIFICATION TRIGGER CRITERIA
  -->
  <xs:complexType name="comm-div-ntfy-trigger-criteria-type">
    <xs:sequence>
      <xs:element name="notification-time-selection-criteria"
        type="time-range-selection-criteria-type"
        minOccurs="0" />
      <xs:element name="presence-status-selection-criteria"
        type="presence-status-selection-criteria-type"
        minOccurs="0" />
 
      <xs:element name="notification-buffer-interval" minOccurs="0" default="86400">
        <xs:simpleType>
          <xs:restriction base="xs:integer">
            <xs:maxInclusive value="86400"/>
          </xs:restriction>
        </xs:simpleType>
      </xs:element>
 
      <xs:any namespace="##other" processContents="lax"
        minOccurs="0" maxOccurs="unbounded"/>
    </xs:sequence>
    <xs:anyAttribute namespace="##other" processContents="lax"/>
  </xs:complexType>

My question is about the yellow and by "empty lines" marked part above.
We have derived the following definition - for test reasons - from above definition and
have added maxOccurs="2".
<xs:complexType name="seq_1">
    <xs:sequence>
      <xs:element name="ct_s_e1" type="xs:integer" minOccurs="0" />
      <xs:element name="ct_s_e2" type="xs:float" minOccurs="0" />
 
      <xs:element name="ct_s_e3_st_res" minOccurs="0" maxOccurs="2">
        <xs:simpleType>
          <xs:restriction base="xs:integer">
            <xs:maxInclusive value="86400"/>
          </xs:restriction>
        </xs:simpleType>
      </xs:element>
 
    </xs:sequence>
</xs:complexType>
What of the three possible mappings would be the correct one for the yellow and by "empty lines" marked part,
as we could not find a definite statement how this should be mapped according to Part 9:

Mapping 1:
type record Seq_1 {
   XSD.Integer ct_s_e1 optional,
   XSD.Float ct_s_e2 optional,
   record length ( 0 .. 2 ) of record {
      XSD.Integer  ct_s_e3_st_res ( -infinity .. 86400 )
   } ct_s_e3_st_res_list
}
with {
   variant "name as 'seq_1'";
   variant(ct_s_e3_st_res_list) "untagged";
   variant(ct_s_e3_st_res_list[-]) "name as 'ct_s_e3_st_res'";
   variant "XSD:integer";
};
Mapping 2:
type record Seq_1 {
   XSD.Integer ct_s_e1 optional,
   XSD.Float ct_s_e2 optional,
   record length ( 0 .. 2 ) of record {
      XSD.Integer  base ( -infinity .. 86400 )
   } ct_s_e3_st_res_list
}
with {
   variant "name as 'seq_1'";
   variant(ct_s_e3_st_res_list) "untagged";
   variant(ct_s_e3_st_res_list[-]) "name as 'ct_s_e3_st_res'";
   variant(ct_s_e3_st_res_list[-].base) "untagged";
   variant "XSD:integer";
};
Mapping 3:
type record Seq_1 {
   XSD.Integer ct_s_e1 optional,
   XSD.Float ct_s_e2 optional,
   record length ( 0 .. 2 ) of  XSD.Integer  ct_s_e3_st_res_list ( -infinity .. 86400 )
 
}
with {
   variant "name as 'seq_1'";
   variant(ct_s_e3_st_res_list) "untagged";
   variant(ct_s_e3_st_res_list[-]) "name as 'ct_s_e3_st_res'";
   variant "XSD:integer";
};

Any response would be appreciated.
With best regards,

Thilo Lauer
Solution Architect
Business Unit ITSM
Bitte beachten Sie die geänderte Telefon- und Faxnummer.
Please note the changed phone and fax number.
[cid:image001.gif@01CC3103.CDE6A710]
Tel.: +49 (0)6151 868-7510
Fax.: +49 (0)6151 868-7264
This email address is being protected from spambots. You need JavaScript enabled to view it.
TTCN team: This email address is being protected from spambots. You need JavaScript enabled to view it.

Devoteam Danet GmbH, Gutenbergstraße 10, 64331 Weiterstadt, Germany
URL: www.devoteam.de
Last Edit: 13 Sep 2013 09:05 by Denis Filatov.
The administrator has disabled public write access.

Mapping of embedded <element><simpleType&​gt;<restriction> with min-/maxOccurs 23 Jun 2011 09:43 #7765

Hi Thilo,

pls. find attached the translated XSD. to have everything in one package I have also added the XSD I have created from your mail.

Two comments:
- if changing the name of the elements in the XSD you are also changing the XSD spec. and the receiving side will not be able to validate the received message (which e.g. expects an XML element tag <notification-time-selection-criteria> but receives the tag <ct_s_e1>).
- adding maxOccurs="2" will change the syntax of the TTCN-3 field from being an optional field to a record of but shall not change the syntax of the encoded XML instance - it allows creating an invalid message containing two instances of <notification-buffer-interval> but in case of 0 or 1 instances it can be validated by the receiver - until the tag names are not changed related the the XSD known by the receiver.

BR, Gyorgy
Attachments:
Last Edit: 13 Sep 2013 09:06 by Denis Filatov.
The administrator has disabled public write access.
  • Page:
  • 1

FacebookTwitterGoogle BookmarksRedditNewsvineTechnoratiLinkedin