xmlschema to ttcn-3 mapping importing xml schema based data types into ttcn-3
TRANSCRIPT
XMLSchema to TTCN-3 MappingXMLSchema to TTCN-3 Mapping
Importing XML schema based data types into TTCN-3
ETSI MTS #40, Berlin, Mar 2005 © FOKUS (2005)
Importing XMLSchema based Datatypes into TTCN-3Importing XMLSchema based Datatypes into TTCN-3
• Overview• XMLSchema built-in datatypes• XMLSchema data type components• Examples
ETSI MTS #40, Berlin, Mar 2005 © FOKUS (2005)
OverviewOverview
TTCN-3 core notation
ASN.1 Types and Values
IDL Interfaces and TypesXMLSchemaTypes
Other Types & Values
Tabular Format
Graphical Format
Other Presentation Formats
PlainText
TTCN-3 User
ETSI MTS #40, Berlin, Mar 2005 © FOKUS (2005)
XMLSchema BuiltIn Types IXMLSchema BuiltIn Types I
anyType
anySimpleType
duration dateTime time date gYearMonth gYear gMonthDay gDay gMonth
boolean base64Binary hexBinary float double anyURI QName NOTATION
all complex types
string decimal
integer
long
int
short
byte
nonNegativeIntegernonPositiveInteger
negativeInteger unsignedLong
unsignedInt
unsignedShort
normalizedString
token
language Name NMToken
NCName NMTokens
positiveInteger
unsignedByte
EntityIDREFID
EntitiesIDREFS
primitive types
derived byrestrictions
derived bylists
hexstringhexstring
charstringcharstring
type integer positiveInteger (0 .. infinity) type integer positiveInteger (0 .. infinity)
type set of NMToken NMTokens type set of NMToken NMTokens
floatfloat
ETSI MTS #40, Berlin, Mar 2005 © FOKUS (2005)
XMLSchema Build-in Types IIXMLSchema Build-in Types II
• XSDAUX.ttcn3 module XSDAUX {
/* 1.string */
type charstring string;
/* 2.boolean */
type integer bitXSD(1,0);
type union booleanXSD
{
bitXSD bit,
boolean bool
}
/* 3.decimal */
type float decimal;
.....
}
ETSI MTS #40, Berlin, Mar 2005 © FOKUS (2005)
XMLSchema datatype componentsXMLSchema datatype components
minInclusive, maxExclusivepattern, enumeration, length ...
schema
alllist
sequence
choice
groupattributecomplexType element
include
import simpleType attributeGroup
attribute
attributeGrouprestriction
union
complexContent
all
choice
sequence
simpleContentextension
restriction
restriction
extension
group
attribute
attributeGroup
all choice sequence group attribute attributeGroup
simpleType facets
minInclusive, maxExclusivepattern, enumeration, length ...
attribute attributeGroup
setset
union
union
recordrecord
unionunion
set of …
set of …
record, union or set
record, union or set
facets
Subtype definition with length, or list restrictions.Ex: Type_string.ttcn3
Subtype definition with length, or list restrictions.Ex: Type_string.ttcn3
ETSI MTS #40, Berlin, Mar 2005 © FOKUS (2005)
ExampleExample
<xs:group name="cust"> <xs:choice> <xs:element name=„e1" type="xs:string"/> <xs:element name=„e2" type="xs:string"/> <xs:element name=„e3" type="xs:string"/> <xs:element name=„e4" type="xs:string"/> </xs:choice></xs:group>
<xs:complexType name=„ORDER"> <xs:choice> <xs:sequence>
<xs:group ref="cust" /> <xs:element name="E" type="xs:byte"/>
</xs:sequence>
<xs:element name=„E" type="xs:int"/> </xs:choice>
<xs:attribute name=„A" type="xs:string"/>
</xs:complexType>
type union cust__Global_Group { XSDAUX.string e1, XSDAUX.string e2, XSDAUX.string e3, XSDAUX.string e4}
type record SEQUENCE__1 {cust__Global_Group sequence__1,XSDAUX.byte E
}
type union CHOICE__2 { SEQUENCE__1 choice__1, XSDAUX.int E}
type charstring A__Attribute__1with {extension "Attribute"};
type set ORDER {CHOICE__2 choice,A__Attribute__1 A optional
}
XMLSchema TTCN-3
ETSI MTS #40, Berlin, Mar 2005 © FOKUS (2005)
The Work DoneThe Work Done
• Initial work by FOKUS in internal research and diploma thesis, 2002-2004
• Discussion of mapping in the TTmedal consortium, 2003-now
• Implementation and case studies• Draft prepared, March 2005• Face-to-face meeting, March 2005
ETSI MTS #40, Berlin, Mar 2005 © FOKUS (2005)
The DocumentThe Document
• 1Scope• 2 References• 3 Abbreviations• 4 Approach• 5 Mapping XSD
Schemas• 6 Ignored schema
components and properties
• 7 TTCN-3 module and namespaces
• 8 Name conversion
• 9 Mapping of built-in data types
• 10 Mapping of data type components
• Annex A (normative): Mapping of Built-In Types
• Annex B (normative): XSDAUX.ttcn3
• Annex C (informative): References
• Annex D (informative): Examples
ETSI MTS #40, Berlin, Mar 2005 © FOKUS (2005)
Contributors/ReviewersContributors/Reviewers
• FOKUS• NetHawk• Nokia • Fraunhofer ESK• University of Göttingen
ETSI MTS #40, Berlin, Mar 2005 © FOKUS (2005)
XML MeetingXML Meeting
• Review of the draft• Discussion
• what to do with non supported features• support for XML values
ETSI MTS #40, Berlin, Mar 2005 © FOKUS (2005)
One issue for all mapping documentsOne issue for all mapping documents
• Name clashes with TTCN-3 keywords
• Consistent resolving rules for all mappings would be helpful
• Proposal to use a „_“ postfix together with an extension attribute indicating the original name
i.e. type boolean boolean_ with {
extension "XSD:boolean"
}
ETSI MTS #40, Berlin, Mar 2005 © FOKUS (2005)
Further TTCN-3 extensions?!Further TTCN-3 extensions?!
Pattern for float and integer
• Length for integer (number of decimal digits)• Different lengths for float (number of fractional
digits, etc.) ?• min and max facets of XML directly added to
TTCN-3 for string types, integer and float ?• whitspace facets for string types ? a more generic approach to „subtyping“ with facets
could be useful
ETSI MTS #40, Berlin, Mar 2005 © FOKUS (2005)
TimingTiming
• Completion till Oct. 2005• Adoption for ETSI MTS #41