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

TOPIC: XSD2TTCN ed.4.4.1: mixed content naming questions

XSD2TTCN ed.4.4.1: mixed content naming questions 27 Nov 2012 14:50 #7814

Hi all,

I have some naming questions regarding XSD2TTCN conversion standard (part 9, ed. 4.4.1):
See highlighted content below:

Section 7.6.8: Mixed content

EXAMPLE 1: Complex type definition with sequence constructor and mixed content type:
<element name="MySeqMixed">
  <xsd:complexType name="MyComplexType-12" mixed="true">
    ...
  </xsd:complexType>
</element>
Is translated to the TTCN-3 type definition
type record MySeqMixedMyComplexType_12 {
  ...
}
with { ... }

And the template
template MySeqMixedMyComplexType_12 t_MySeqMixedMyComplexType_12 := {
  embed_values:= {"The ordered", "has arrived", "Wait for further information."},
  a:= "car",
  b:= true
}
will be encoded as
<MySeqMixedMyComplexType-12>
  ...
</MySeqMixedMyComplexType-12>

Question 1 regarding Example 1:
Where is this name concatenation rule (MySeqMixedMyComplexType_12) specified?
Or should this instead be translated to:
type record MyComplexType_12 {
  ...
}
with {
  variant "name as 'MySeqMixed'";
}


EXAMPLE 2: Complex type definition with sequence constructor of multiple occurrences and mixed content
type:
<element name="MyComplexElem-16">
  <xsd:complexType name="MyComplexType-16" mixed="true">
    ...
  </xsd:complexType>
</element>

Is translated to the TTCN-3 type definition
type record MyComplexTypeElem_16 {
  ...
}
with {
  variant "name as 'MyComplexElem-16'";
  variant "element"
  variant "embedValues"
}
And the template
template MyComplexTypeElem_16 t_MyComplexTypeElem_16 := {
  ...
}
will be encoded as
<MyComplexTypeElem_16>
  ...
</MyComplexTypeElem_16>

Question 2 regarding Example 2: (same issue for Example 3)
Where is this name conversion rule (MyComplexElem-16 MyComplexType-16 converted to MyComplexTypeElem_16) specified?
Or should this instead be translated to:
type record MyComplexType_16 {
  ...
}
with {
  variant "name as 'MyComplexElem-16'";
}

Question 3:
If both, the element and/or the complexType have a name, which one shall be taken?

Question 4:
What about nested, non-global complexType definitions with mixed="true" and name="..."?
<element name="MyComplexElem-77">
  <xsd:complexType name="MyComplexType-77" mixed="true">
    ...
    <xsd:complexType name="MyNestedComplexType-99" mixed="true">
      ...
    </xsd:complexType>
    ...
  </xsd:complexType>
</element>

Is translated to the TTCN-3 type definition
type record MyComplexType_77 {
  ...
  record { // MyNestedComplexType_99 cannot be used here, therefore it has to be ignored - right?
    ...
  }
  ...
}
with {
  variant "name as 'MyComplexElem-77'";
}

Many thanks for any response.

Regards,
Thilo Lauer
Last Edit: 30 Jul 2013 09:50 by Denis Filatov.
The administrator has disabled public write access.

XSD2TTCN ed.4.4.1: mixed content naming questions 29 Nov 2012 11:54 #7815

Hello Thilo,

As far as I know, element-internal complexType elements cannot have an own
name-attribute and therefore, these are always to be ignored.

In my opinion, the examples you quote are wrong (which probably causes your
confusion), i.e. in violation of the rest of the specification.

In all of them, the name-attribute of the complexType elements should be
ignored and the normal name mapping for the element to a record type shall
be used as specified in the name conversion section.

Since further internal types must be internal inside an internal
element-element, the name conversion rules shall be applied to that
element's name to yield the name of the internal record field.

BR, Jacob Wieland


2012/11/27 Lauer Thilo <This email address is being protected from spambots. You need JavaScript enabled to view it.>
Last Edit: 15 Jul 2013 08:07 by Silvia Almagia.
The administrator has disabled public write access.

XSD2TTCN ed.4.4.1: mixed content naming questions 29 Nov 2012 12:12 #7816

Hello Jacob,

Right after sending my questions we found, that the XSD examples causes XSD-validation errors indicating what you stated in your answer.
Then it is clear now, how this issue should be handled.
Thanks for your response.

Regards,

Thilo Lauer
Last Edit: 15 Jul 2013 08:08 by Silvia Almagia.
The administrator has disabled public write access.

XSD2TTCN ed.4.4.1: mixed content naming questions 30 Nov 2012 08:54 #7817

Hi Thilo,

Yes, the name attribute in the complex type element is an error in the example. Also the "concatenated" names are wrong, they are the result of editorial error; shall be just MySeqMixed all over the example, i.e. in the type and template definitions and in the encoded XML.

However, the standard requires in clause 5 that " The mapping shall start on a set of valid XSD schema-s and shall result in a set of valid TTCN-3 modules."; i.e. the TTCN-3 tool or a converter shall cause error just like in case of syntactical errors in TTCN-3 modules.

Could you pls. submit a CR on part 9 at t-ort.etsi.org/main_page.php? and I will correct the example during the next session of the language maintenance STF, during w50.

BR, GYorgy

The corrected example is:
7.6.8 Mixed content
Wrong mixed content example:
<element name="MySeqMixed">
    <xsd:complexType mixed="true">
       <xsd:sequence>
           <xsd:element name="a" type="xsd:string"/>
           <xsd:element name="b" type="xsd:boolean"/>
       </xsd:sequence>
       <attribute name="attrib" type="integer"/>
    </xsd:complexType>
</element>
Is translated to the TTCN-3 type definition
type record MySeqMixed {
    record of XSD.String  embed_values,
    // in TTCN-3 values the embed_values field may have max. 3 record of components
    XSD.Integer attrib optional,
    XSD.String a,
    XSD.Boolean b
}
with {
    variant "element";
    variant "embedValues";
    variant(attrib) "attribute"
}
And the template
template MySeqMixed t_MySeqMixed := {
    embed_values:= {"The ordered", "has arrived", "Wait for further information."},
    attrib := omit,
    a := "car",
    b := true
}
will be encoded, for example as
<ns:MySeqMixed xmlns:ns='http://www.example.org/mixed'>The ordered<a>car</a>has arrived<b>true</b>Wait for further information.</ns:MySeqMixed>
Last Edit: 30 Jul 2013 09:52 by Denis Filatov.
The administrator has disabled public write access.
  • Page:
  • 1

FacebookTwitterGoogle BookmarksRedditNewsvineTechnoratiLinkedin