/******************************************************************************
* Copyright (c) 2000-2021 Ericsson Telecom AB
*
* XSD to TTCN-3 Translator
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html
*
* Contributors:
*   Balasko, Jeno
*   Szabo, Bence Janos
*
******************************************************************************/
//
//  File:          www_example_org_type_substitution_chain.ttcn
//  Description:
//  References:
//  Rev:
//  Prodnr:
//  Updated:       Tue Nov 17 11:30:22 2014
//  Contact:       http://ttcn.ericsson.se
//
////////////////////////////////////////////////////////////////////////////////
//	Generated from file(s):
//	- type_substitution_chain.xsd
//			/* xml version = "1.0" encoding = "UTF-8" */
//			/* targetnamespace = "www.example.org/type/substitution/chain" */
////////////////////////////////////////////////////////////////////////////////
//     Modification header(s):
//-----------------------------------------------------------------------------
//  Modified by:
//  Modification date:
//  Description:
//  Modification contact:
//------------------------------------------------------------------------------
////////////////////////////////////////////////////////////////////////////////


module www_example_org_type_substitution_chain {


import from XSD all;


type ParentType_derivations Head
with {
  variant "name as uncapitalized";
  variant "element";
};


/* SUBSTITUTABLE PARENT TYPE */


/* type substitutiongroup generated, because has elemet declaration */


type record ParentType
{
	record of XSD.String foo_list,
	XSD.String bar
}
with {
  variant (foo_list) "untagged";
  variant (foo_list[-]) "name as 'foo'";
};


type RestrictedType_derivations RestrictedTypeElem
with {
  variant "element";
};


/* type substitutiongroup generated, because has elemet declaration */


type record RestrictedType
{
	record length(1 .. infinity) of XSD.String foo_list,
	XSD.String bar
}
with {
  variant "name as uncapitalized";
  variant (foo_list) "untagged";
  variant (foo_list[-]) "name as 'foo'";
};


/* type substitutiongroup generated, because the parent has elemet declaration */


type record RestrictedType2
{
	record length(2 .. infinity) of XSD.String foo_list,
	XSD.String bar
}
with {
  variant "name as uncapitalized";
  variant (foo_list) "untagged";
  variant (foo_list[-]) "name as 'foo'";
};


/* Added to restrictedtype_derivations */


type record RestrictedType2_1
{
	record length(2 .. 5) of XSD.String foo_list,
	XSD.String bar
}
with {
  variant "name as 'restrictedType2.1'";
  variant (foo_list) "untagged";
  variant (foo_list[-]) "name as 'foo'";
};


/* No type substitutiongroup generated, because the parent lacks elemet declaration */


type record RestrictedType3
{
	record length(3 .. infinity) of XSD.String foo_list,
	XSD.String bar
}
with {
  variant "name as uncapitalized";
  variant (foo_list) "untagged";
  variant (foo_list[-]) "name as 'foo'";
};


type union ParentType_derivations
{
	@default ParentType parentType,
	RestrictedType restrictedType,
	RestrictedType2 restrictedType2,
	RestrictedType2_1 restrictedType2_1,
	RestrictedType3 restrictedType3
}
with {
  variant "useType";
  variant (parentType) "name as capitalized";
  variant (restrictedType2_1) "name as 'restrictedType2.1'";
};


type union RestrictedType_derivations
{
	@default RestrictedType restrictedType,
	RestrictedType2 restrictedType2,
	RestrictedType2_1 restrictedType2_1,
	RestrictedType3 restrictedType3
}
with {
  variant "useType";
  variant (restrictedType2_1) "name as 'restrictedType2.1'";
};


}
with {
  encode "XML";
  variant "namespace as 'www.example.org/type/substitution/chain' prefix 'tys'";
  variant "controlNamespace 'http://www.w3.org/2001/XMLSchema-instance' prefix 'xsi'";
}
