130 likes | 254 Views
The XML to TTCN-3 Mapping Contact: Ina Schieferdecker, schieferdecker@fokus.fraunhofer.de , +49 30 3463 7241. Mapping XML to TTCN-3. Map element tags and attributes to TTCN-3 fields and types Different mappings Embedded approach Flat-Catalog approach Named Type approach.
E N D
The XML to TTCN-3 Mapping Contact: Ina Schieferdecker, schieferdecker@fokus.fraunhofer.de, +49 30 3463 7241
Mapping XML to TTCN-3 • Map element tags and attributes to TTCN-3 fields and types • Different mappings • Embedded approach • Flat-Catalog approach • Named Type approach
Mapping Schemas in Embedded Approach <schema> <element name="weather"> <complexType> <sequence> <element name="location"> <complexType > <sequence> <simpleType name="city"> <restriction base="string"> <pattern value="[a-zA-Z]"/> </restriction> </simpleType> <element name="country" type="string"/> </sequence> </complexType> </element> <element name="temperature" type="integer"/> <element name="barometric_pressure" type="integer"/> <element name="conditions" type="string"/> </sequence> </complexType> </element> </schema> XML Schema typerecordweatherType { locationTypelocation, integertemperature, integerbarometric_pressure, charstringconditions } typerecordlocationType { charstringcity ("a".."z","A".."Z"), charstringcountry } TTCN-3 Types
Mapping Schemas in Flat Catalog Approach <schema> <element name="temperature" type="integer"/> <element name="barometric_pressure" type="integer"/> <element name="conditions" type="string"/> <element name="country" type="string"/> <simpleType name="city"> <restriction base="string"> <pattern value="[a-zA-Z]"/> </restriction> </simpleType> <element name="location"> <complexType > <sequence> <element ref="city"/> <element ref="country"/> </sequence> </complexType> </element> <element name="weather"> <complexType> <sequence> <element ref="location"/> <element ref="temperature"/> <element ref="barometric_pressure"/> <element ref="conditions"/> </sequence> </complexType> </element> </schema> XML Schema TTCN-3 Types typeintegertemperatureType; typeintegerbarometric_pressureType; typecharstringconditionsType; typecharstringcountryType; typecharstringcityType ("a".."z","A".."Z"); typerecordlocationType { cityTypecity, countryTypecountry } typerecordweatherType { locationTypelocation, temperatureTypetemperature, barometric_pressureTypebarometric_pressure, conditionsTypeconditions }
Mapping Schemas in Named Type Approach <schema> <complexType name="weatherType" > <sequence> <element name="location" type="locationType"/> <element name="temperature" type="integer"/> <element name="barometric_pressure" type="integer"/> <element name="conditions" type="string"/> </sequence> </complexType> <complexType name="locationType" > <sequence> <element name="city" type="cityType"/> <element name="country" type="string"/> </sequence> </complexType> <simpleType name="cityType"> <restriction base="string"> <pattern value="[a-zA-Z]"/> </restriction> </simpleType> <element name="weather" type="weatherType"/> </schema> XML Schema TTCN-3 Types typerecord weatherType { locationType location, integer temperature, integer barometric_pressure, charstring conditions } typerecord locationType { cityType city, countryType country } typecharstring cityType ("a".."z","A".."Z");
The Principle XML DTD XML Schema XML Schema Implicit/explicit mapping In analogy to TTCN-3 ASN.1
Project progress Proposed change of dates for the WI Milestones: • First Draft: MTS#39 • TB approval: MTS#40