Commit a5ae5a74 authored by BenceJanosSzabo's avatar BenceJanosSzabo
Browse files

xsd2ttcn does not generate 'name as' variants for artifically generated types (Bug 520190)



Change-Id: Ifba07e3e74a50cdcf9c1d33ccc57195fea06152b
Signed-off-by: default avatarBenceJanosSzabo <bence.janos.szabo@ericsson.com>
parent 281ed8df
......@@ -143,7 +143,6 @@ type union RequestAbstractType_derivations
MyProgrammingRequestType myProgrammingRequestType
}
with {
variant "name as uncapitalized";
variant "useType";
variant (requestAbstractType) "abstract";
};
......
......@@ -195,7 +195,6 @@ type union RestrictedType_derivations
RestrictedType3 restrictedType3
}
with {
variant "name as uncapitalized";
variant "useType";
variant (restrictedType2_1) "name as 'restrictedType2.1'";
};
......@@ -207,7 +206,6 @@ type union ExtendedType_derivations
RestrictedExtendedType restrictedExtendedType
}
with {
variant "name as uncapitalized";
variant "useType";
variant (restrictedExtendedType) "block";
};
......
......@@ -96,7 +96,6 @@ type union String_derivations
Session session
}
with {
variant "name as uncapitalized";
variant "useType";
};
......
......@@ -157,7 +157,6 @@ type union RestrictedType_derivations
RestrictedType3 restrictedType3
}
with {
variant "name as uncapitalized";
variant "useType";
variant (restrictedType2_1) "name as 'restrictedType2.1'";
};
......
......@@ -154,7 +154,6 @@ type union RequestType_derivations
MyProductionRequestType4 myProductionRequestType4
}
with {
variant "name as uncapitalized";
variant "useType";
};
......@@ -167,7 +166,6 @@ type union MyProductionRequestType_derivations
MyProductionRequestType4 myProductionRequestType4
}
with {
variant "name as uncapitalized";
variant "useType";
};
......@@ -179,7 +177,6 @@ type union MyProductionRequestType2_derivations
MyProductionRequestType4 myProductionRequestType4
}
with {
variant "name as uncapitalized";
variant "useType";
};
......
......@@ -108,7 +108,6 @@ type union String_derivations
Stringtype2 stringtype2
}
with {
variant "name as uncapitalized";
variant "useType";
};
......@@ -119,7 +118,6 @@ type union Stringtype_derivations
Stringtype2 stringtype2
}
with {
variant "name as uncapitalized";
variant "useType";
};
......@@ -144,7 +142,6 @@ type union RestrictedType_derivations
MorerestrictedType morerestrictedType
}
with {
variant "name as uncapitalized";
variant "useType";
variant (morerestrictedType) "block";
};
......
......@@ -165,7 +165,6 @@ type union RestrictedType_derivations
RestrictedType3 restrictedType3
}
with {
variant "name as uncapitalized";
variant "useType";
variant (restrictedType2_1) "name as 'restrictedType2.1'";
};
......
......@@ -101,7 +101,6 @@ type union ExtendedType_derivations
RestrictedExtendedType restrictedExtendedType
}
with {
variant "name as uncapitalized";
variant "useType";
variant (restrictedExtendedType) "block";
};
......
......@@ -105,7 +105,6 @@ type union String_derivations
Stringtype4 stringtype4
}
with {
variant "name as uncapitalized";
variant "useType";
};
......@@ -118,7 +117,6 @@ type union Stringtype_derivations
Stringtype4 stringtype4
}
with {
variant "name as uncapitalized";
variant "useType";
};
......@@ -130,7 +128,6 @@ type union Stringtype2_derivations
Stringtype4 stringtype4
}
with {
variant "name as uncapitalized";
variant "useType";
};
......@@ -141,7 +138,6 @@ type union Stringtype3_derivations
Stringtype4 stringtype4
}
with {
variant "name as uncapitalized";
variant "useType";
};
......
......@@ -148,7 +148,6 @@ type union String_derivations
Stringtype2 stringtype2
}
with {
variant "name as uncapitalized";
variant "useType";
};
......@@ -159,7 +158,6 @@ type union Stringtype_derivations
Stringtype2 stringtype2
}
with {
variant "name as uncapitalized";
variant "useType";
};
......@@ -170,7 +168,6 @@ type union Integer_derivations
ExtInt extInt
}
with {
variant "name as uncapitalized";
variant "useType";
variant (integer_) "name as 'integer'";
};
......@@ -182,7 +179,6 @@ type union Base64Binary_derivations
CrypBinary crypBinary
}
with {
variant "name as uncapitalized";
variant "useType";
variant (crypBinary) "name as capitalized";
};
......
......@@ -165,7 +165,7 @@ ComplexType::ComplexType(const SimpleType & other, CT_fromST c)
, enumfields()
, tagNames() {
if(c != fromTagSubstitution && c != fromTypeSubstitution){
if(c != fromElementSubstitution && c != fromTypeSubstitution){
module->replaceLastMainType(this);
module->setActualXsdConstruct(c_complexType);
}
......@@ -185,7 +185,7 @@ ComplexType::ComplexType(const SimpleType & other, CT_fromST c)
type.upload(Mstring("record"), false);
xsdtype = n_complexType;
break;
case fromTagSubstitution:
case fromElementSubstitution:
type.upload(Mstring("union"), false);
name.upload(getName().originalValueWoPrefix + Mstring("_group"));
xsdtype = n_union;
......@@ -860,7 +860,8 @@ void ComplexType::nameConversion_names(const List<NamespaceType> &) {
break;
}
}
if (!found) {
// element or type substitution generated types do not need 'name as' variant
if (!found && subsGroup != this && typeSubsGroup != this) {
addVariant(V_onlyValue, var);
}
for (List<RootType*>::iterator dep = nameDepList.begin(); dep; dep = dep->Next) {
......@@ -2273,7 +2274,7 @@ void ComplexType::modifyAttributeParent() {
void ComplexType::addSubstitution(SimpleType * st){
ComplexType * element;
if(st->getXsdtype() == n_NOTSET || !complexfields.empty()){
element = new ComplexType(*st, fromTagSubstitution);
element = new ComplexType(*st, fromElementSubstitution);
}else {
element = new ComplexType(*(ComplexType*)st);
element->variant.clear();
......
......@@ -50,7 +50,7 @@ public:
fromTagUnion,
fromTagNillable,
fromTagComplexType,
fromTagSubstitution,
fromElementSubstitution,
fromTypeSubstitution
};
......
......@@ -339,7 +339,7 @@ void SimpleType::addToSubstitutions(){
substitutionGroup = empty_string;
//Simpletype
if(st->subsGroup == NULL){
ComplexType * head_element = new ComplexType(*st, ComplexType::fromTagSubstitution);
ComplexType * head_element = new ComplexType(*st, ComplexType::fromElementSubstitution);
for(List<RootType*>::iterator simpletype = st->nameDepList.begin(); simpletype; simpletype = simpletype->Next){
head_element->getNameDepList().push_back(simpletype->Data);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment