Loading 08_substitutions/0801_element_substitution/080101_head_elements_of_substitution_groups/Pos_080101_head_elements_of_substitution_groups_001/Pos_080101_head_elements_of_substitution_groups_001.ttcn_ 0 → 100644 +19 −0 Original line number Diff line number Diff line /*************************************************** ** @author STF 475 ** @version 0.0.1 ** @purpose 9:8.1.1, Generic substitution group example ** @verdict pass accept, ttcn3verdict:pass ***************************************************/ module Pos_080101_head_elements_of_substitution_groups_001 { import from schema_Pos_080101_head_elements_of_substitution_groups_001 language "XSD" all; template Ize m_msg := { { head := "anything" }, { member1 := "any thing" }, { member2 := something }, { member3 := { bar:= 5, foo := omit, base := "anything else" } } } //#TC } 08_substitutions/0801_element_substitution/080101_head_elements_of_substitution_groups/Pos_080101_head_elements_of_substitution_groups_001/Pos_080101_head_elements_of_substitution_groups_001.xml 0 → 100644 +5 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="UTF-8"?> <ns:ize xmlns:ns="schema:Pos_080101_head_elements_of_substitution_groups_001" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="schema:Pos_080101_head_elements_of_substitution_groups_001 Pos_080101_head_elements_of_substitution_groups_001.xsd"> <ns:head>anything</ns:head> <ns:member1>any thing</ns:member1> <ns:member2>something</ns:member2> <ns:member3>akarmi</ns:member3> <ns:member3 bar="5" >anything else</ns:member3> </ns:ize> No newline at end of file 08_substitutions/0801_element_substitution/080101_head_elements_of_substitution_groups/Pos_080101_head_elements_of_substitution_groups_001/Pos_080101_head_elements_of_substitution_groups_001.xsd 0 → 100644 +35 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="UTF-8"?> <schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="schema:Pos_080101_head_elements_of_substitution_groups_001" xmlns:ns="schema:Pos_080101_head_elements_of_substitution_groups_001"> <!-- THE HEAD ELEMENT --> <element name="head" type="string"/> <!-- SUBSTITUTION ELEMENT OF THE SAME TYPE AS THE HEAD --> <element name="member1" type="string" substitutionGroup="ns:head"/> <!-- SUBSTITUTION ELEMENT OF A TYPE RESTRICTING THE TYPE OF THE HEAD --> <simpleType name="stringEnum"> <restriction base="string"> <enumeration value="something"/> <enumeration value="else"/> </restriction> </simpleType> <element name="member2" type="ns:stringEnum" substitutionGroup="ns:head"/> <!-- SUBSTITUTION ELEMENT OF A TYPE EXTENDING THE TYPE OF THE HEAD --> <complexType name="complexEnum"> <simpleContent> <extension base="string"> <attribute name="foo" type="float"/> <attribute name="bar" type="integer"/> </extension> </simpleContent> </complexType> <element name="member3" type="ns:complexEnum" substitutionGroup="ns:head"/> <!-- TOP LEVEL ELEMENT TO DEMONSTRATE SUBSTITUTION --> <element name="ize"> <complexType> <sequence> <element ref="ns:head" minOccurs="0" maxOccurs="unbounded"/> </sequence> </complexType> </element> </schema> No newline at end of file 08_substitutions/0801_element_substitution/080101_head_elements_of_substitution_groups/Pos_080101_head_elements_of_substitution_groups_002/Pos_080101_head_elements_of_substitution_groups_002.ttcn_ 0 → 100644 +19 −0 Original line number Diff line number Diff line /*************************************************** ** @author STF 475 ** @version 0.0.1 ** @purpose 9:8.1.1, Show effect of the block and abstract attributes on element substitution ** @verdict pass accept, ttcn3verdict:pass ***************************************************/ module Pos_080101_head_elements_of_substitution_groups_002 { import from schema_Pos_080101_head_elements_of_substitution_groups_002 language "XSD" all; template Ize m_msg := { { head := "anything" }, { member1 := "any thing" }, { member2 := something }, { member3 := { bar:= 5, foo := omit, base := "anything else" } } } //#TC } 08_substitutions/0801_element_substitution/080101_head_elements_of_substitution_groups/Pos_080101_head_elements_of_substitution_groups_002/Pos_080101_head_elements_of_substitution_groups_002.xml 0 → 100644 +10 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="UTF-8"?> <ns:ize xmlns:ns="schema:Pos_080101_head_elements_of_substitution_groups_002" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="schema:Pos_080101_head_elements_of_substitution_groups_002 Pos_080101_head_elements_of_substitution_groups_002.xsd"> <!-- allowed to send but causes a decoding failure if present in the received XML document ( the head element is abstract) --> <ns:head>anything</ns:head> <!-- OK to send and receive --> <ns:member1>any thing</ns:member1> <!-- allowed to send but causes a decoding failure if present in the received XML document ( the type of member2 is derived by restriction in XSD) --> <ns:member2>something</ns:member2> <!-- OK to send and receive (the type of member3 is derived by extension in XSD) --> <ns:member3>akarmi</ns:member3> <ns:member3 bar="5" >anything else</ns:member3> </ns:ize> No newline at end of file Loading
08_substitutions/0801_element_substitution/080101_head_elements_of_substitution_groups/Pos_080101_head_elements_of_substitution_groups_001/Pos_080101_head_elements_of_substitution_groups_001.ttcn_ 0 → 100644 +19 −0 Original line number Diff line number Diff line /*************************************************** ** @author STF 475 ** @version 0.0.1 ** @purpose 9:8.1.1, Generic substitution group example ** @verdict pass accept, ttcn3verdict:pass ***************************************************/ module Pos_080101_head_elements_of_substitution_groups_001 { import from schema_Pos_080101_head_elements_of_substitution_groups_001 language "XSD" all; template Ize m_msg := { { head := "anything" }, { member1 := "any thing" }, { member2 := something }, { member3 := { bar:= 5, foo := omit, base := "anything else" } } } //#TC }
08_substitutions/0801_element_substitution/080101_head_elements_of_substitution_groups/Pos_080101_head_elements_of_substitution_groups_001/Pos_080101_head_elements_of_substitution_groups_001.xml 0 → 100644 +5 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="UTF-8"?> <ns:ize xmlns:ns="schema:Pos_080101_head_elements_of_substitution_groups_001" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="schema:Pos_080101_head_elements_of_substitution_groups_001 Pos_080101_head_elements_of_substitution_groups_001.xsd"> <ns:head>anything</ns:head> <ns:member1>any thing</ns:member1> <ns:member2>something</ns:member2> <ns:member3>akarmi</ns:member3> <ns:member3 bar="5" >anything else</ns:member3> </ns:ize> No newline at end of file
08_substitutions/0801_element_substitution/080101_head_elements_of_substitution_groups/Pos_080101_head_elements_of_substitution_groups_001/Pos_080101_head_elements_of_substitution_groups_001.xsd 0 → 100644 +35 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="UTF-8"?> <schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="schema:Pos_080101_head_elements_of_substitution_groups_001" xmlns:ns="schema:Pos_080101_head_elements_of_substitution_groups_001"> <!-- THE HEAD ELEMENT --> <element name="head" type="string"/> <!-- SUBSTITUTION ELEMENT OF THE SAME TYPE AS THE HEAD --> <element name="member1" type="string" substitutionGroup="ns:head"/> <!-- SUBSTITUTION ELEMENT OF A TYPE RESTRICTING THE TYPE OF THE HEAD --> <simpleType name="stringEnum"> <restriction base="string"> <enumeration value="something"/> <enumeration value="else"/> </restriction> </simpleType> <element name="member2" type="ns:stringEnum" substitutionGroup="ns:head"/> <!-- SUBSTITUTION ELEMENT OF A TYPE EXTENDING THE TYPE OF THE HEAD --> <complexType name="complexEnum"> <simpleContent> <extension base="string"> <attribute name="foo" type="float"/> <attribute name="bar" type="integer"/> </extension> </simpleContent> </complexType> <element name="member3" type="ns:complexEnum" substitutionGroup="ns:head"/> <!-- TOP LEVEL ELEMENT TO DEMONSTRATE SUBSTITUTION --> <element name="ize"> <complexType> <sequence> <element ref="ns:head" minOccurs="0" maxOccurs="unbounded"/> </sequence> </complexType> </element> </schema> No newline at end of file
08_substitutions/0801_element_substitution/080101_head_elements_of_substitution_groups/Pos_080101_head_elements_of_substitution_groups_002/Pos_080101_head_elements_of_substitution_groups_002.ttcn_ 0 → 100644 +19 −0 Original line number Diff line number Diff line /*************************************************** ** @author STF 475 ** @version 0.0.1 ** @purpose 9:8.1.1, Show effect of the block and abstract attributes on element substitution ** @verdict pass accept, ttcn3verdict:pass ***************************************************/ module Pos_080101_head_elements_of_substitution_groups_002 { import from schema_Pos_080101_head_elements_of_substitution_groups_002 language "XSD" all; template Ize m_msg := { { head := "anything" }, { member1 := "any thing" }, { member2 := something }, { member3 := { bar:= 5, foo := omit, base := "anything else" } } } //#TC }
08_substitutions/0801_element_substitution/080101_head_elements_of_substitution_groups/Pos_080101_head_elements_of_substitution_groups_002/Pos_080101_head_elements_of_substitution_groups_002.xml 0 → 100644 +10 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="UTF-8"?> <ns:ize xmlns:ns="schema:Pos_080101_head_elements_of_substitution_groups_002" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="schema:Pos_080101_head_elements_of_substitution_groups_002 Pos_080101_head_elements_of_substitution_groups_002.xsd"> <!-- allowed to send but causes a decoding failure if present in the received XML document ( the head element is abstract) --> <ns:head>anything</ns:head> <!-- OK to send and receive --> <ns:member1>any thing</ns:member1> <!-- allowed to send but causes a decoding failure if present in the received XML document ( the type of member2 is derived by restriction in XSD) --> <ns:member2>something</ns:member2> <!-- OK to send and receive (the type of member3 is derived by extension in XSD) --> <ns:member3>akarmi</ns:member3> <ns:member3 bar="5" >anything else</ns:member3> </ns:ize> No newline at end of file