Skip to content
Snippets Groups Projects
Commit fc481247 authored by BenceJanosSzabo's avatar BenceJanosSzabo
Browse files

xsd2ttcn: enumeration in union conversion fix (Bug 511912)


Change-Id: I83ec8fd50fe35e14b18dce643b4dc7b8a8e41656
Signed-off-by: default avatarBenceJanosSzabo <bence.janos.szabo@ericsson.com>
parent f9633f1f
No related branches found
No related tags found
No related merge requests found
...@@ -154,6 +154,26 @@ type Only_int Ints ( ...@@ -154,6 +154,26 @@ type Only_int Ints (
); );
type union UnionWithEnumField
{
enumerated {
x,
none_,
type_
} alt_,
XSD.PositiveInteger alt_1 (1 .. !1000000)
}
with {
variant "useUnion";
variant "element";
variant (alt_) "name as ''";
variant (alt_) "text 'none_' as 'none'";
variant (alt_) "text 'type_' as 'type'";
variant (alt_) "text 'x' as ''";
variant (alt_1) "name as ''";
};
} }
with { with {
encode "XML"; encode "XML";
......
...@@ -125,4 +125,23 @@ ...@@ -125,4 +125,23 @@
</xs:restriction> </xs:restriction>
</xs:simpleType> </xs:simpleType>
<xs:element name="UnionWithEnumField">
<xs:simpleType>
<xs:union>
<xs:simpleType>
<xs:restriction base="xs:normalizedString">
<xs:enumeration value=""/>
<xs:enumeration value="none"/>
<xs:enumeration value="type"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType>
<xs:restriction base="xs:positiveInteger">
<xs:maxExclusive value="1000000"/>
</xs:restriction>
</xs:simpleType>
</xs:union>
</xs:simpleType>
</xs:element>
</xs:schema> </xs:schema>
...@@ -148,7 +148,7 @@ public: ...@@ -148,7 +148,7 @@ public:
} }
QualifiedName(const Mstring& ns, const Mstring nm) QualifiedName(const Mstring& ns, const Mstring nm)
: nsuri(ns), name(nm), dup(false) { : nsuri(ns), name(nm), orig_name(nm), dup(false) {
} }
QualifiedName(const Mstring& ns, const Mstring nm, const Mstring orig) QualifiedName(const Mstring& ns, const Mstring nm, const Mstring orig)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment