Skip to content
Snippets Groups Projects
Select Git revision
  • Release4-onwards default protected
  • Release3-onwards protected
  • Release2-onwards protected
  • Release4-onwards-work-not-committed
  • Release3 protected
  • Release2 protected
  • Release4 protected
  • Release4-onwards-SSM-Testcases-Backlog
  • Release4-onwards-PrimitiveProfile-NewTestCases
  • Release3-onwards-3GPP-DeviceTriggering
  • Titan-corrections
  • Release4-onwards-Sec
  • master protected
  • Release1 protected
  • Release1-onwards protected
  • ATS_SEC
  • TS-0019-baseline-v4_1_1
  • TS-0019-baseline-v3_5_1
  • TS-0019-baseline-v2_9_1
  • TS-0019-baseline-v3_4_0
  • TS-0019-baseline-v2_8_0
  • TS-0019-baseline-v4_1_0
  • TS-0019-baseline-v4_0_0
  • TS-0019-baseline-v3_3_0
  • TS-0019-baseline-v2_7_0
  • TS-0019-baseline-v3_2_0
  • TS-0019-baseline-v2_6_0
  • TDE-2020-0049-TS-0019-baseline-v3_1_0
  • TDE-2020-0042-TS-0019-baseline-v2_5_0
  • TDE-2019-163-TS-0019-baseline-v2_4_0
  • TDE-2019-0106-TS-0019-baseline-v2_3_0
  • TST-2018-0148-TS-0019_TTCN-3_Test_cases_Release_2
  • TST-2018-0148-TS-0019_TTCN-3_Test_cases_Release_1
  • TST-2018-0109-TS-0019_TTCN-3_Test_cases_Release_2
  • TST-2018-0109-TS-0019_TTCN-3_Test_cases_Release_1
  • TST-2018-0039R01-TS-0019_TTCN-3_Test_cases
36 results

XSD.ttcn

Blame
  • XSD.ttcn 6.30 KiB
    /**
     *  Copyright Notification
     *  No part of this document may be reproduced, in an electronic retrieval system or otherwise, except as authorized by written permission.
     *  The copyright and the foregoing restriction extend to reproduction in all media.
     *  © 2016, oneM2M Partners Type 1 (ARIB, ATIS, CCSA, ETSI, TIA, TSDSI, TTA, TTC).
     *  All rights reserved.
     *  
     *  @author     ETSI
     *  @version    $URL: https://forge.etsi.org/svn/oneM2M/trunk/ttcn/LibOneM2M/XSD.ttcn $
     *              $Id: XSD.ttcn 102 2016-08-30 09:28:49Z reinaortega $
     *  @desc       Test System module for oneM2M
     *
     */
    module XSD {
    
    import from UsefulTtcn3Types all;
    
    //These constants are used in the XSD date/time type definitions
    const charstring
      dash := "-",
      cln  := ":",
      year := "[0-9]#4",
      yearExpansion := "(-([1-9][0-9]#(0,))#(,1))#(,1)",
      month := "(0[1-9]|1[0-2])",
      dayOfMonth := "(0[1-9]|[12][0-9]|3[01])",
      hour := "([01][0-9]|2[0-3])",
      minute := "([0-5][0-9])",
      second := "([0-5][0-9])",
      sFraction := "(.[0-9]#(1,))#(,1)",
      endOfDayExt := "24:00:00(.0#(1,))#(,1)",
      nums := "[0-9]#(1,)",
      ZorTimeZoneExt := "(Z|[+-]((0[0-9]|1[0-3]):[0-5][0-9]|14:00))#(,1)",
      durTime := "(T[0-9]#(1,)"&
                 "(H([0-9]#(1,)(M([0-9]#(1,)(S|.[0-9]#(1,)S))#(,1)|.[0-9]#(1,)S|S))#(,1)|"&
                 "M([0-9]#(1,)(S|.[0-9]#(1,)S)|.[0-9]#(1,)M)#(,1)|"&
                 "S|"&
                 ".[0-9]#(1,)S))";
    
    //anySimpleType
    
    type XMLCompatibleString AnySimpleType
    with {
    variant "XSD:anySimpleType";
    };
    
    //anyType;
    
    type record AnyType
    {
    	record of String embed_values optional,
    	record of String attr optional,
    	record of String elem_list
    }
    with {
    variant "XSD:anyType";
    //variant "embedValues";
    //variant (attr) "anyAttributes";
    //variant (elem_list) "anyElement";
    };
    // String types
    
    type XMLCompatibleString String
    with {
    variant "XSD:string";
    };
    
    type XMLStringWithNoCRLFHT NormalizedString
    with {
    variant "XSD:normalizedString";
    };
    
    type NormalizedString Token
    with {
    variant "XSD:token";
    };
    
    type XMLStringWithNoWhitespace Name
    with {
    variant "XSD:Name";
    };
    
    type XMLStringWithNoWhitespace NMTOKEN
    with {
    variant "XSD:NMTOKEN";
    };
    
    type Name NCName
    with {
    variant "XSD:NCName";
    };
    
    type NCName ID
    with {
    variant "XSD:ID";
    };
    
    type NCName IDREF
    with {
    variant "XSD:IDREF";
    };
    
    type NCName ENTITY
    with {
    variant "XSD:ENTITY";
    };
    
    type octetstring HexBinary
    with {
    variant "XSD:hexBinary";
    };
    
    type octetstring Base64Binary
    with {
    variant "XSD:base64Binary";
    };
    
    type XMLStringWithNoCRLFHT AnyURI
    with {
    variant "XSD:anyURI";
    };
    
    type charstring Language (pattern "[a-zA-Z]#(1,8)(-\w#(1,8))#(0,)")
    with {
    variant "XSD:language";
    };
    // Integer types
    
    type integer Integer
    with {
    variant "XSD:integer";
    };
    
    type integer PositiveInteger (1 .. infinity)
    with {
    variant "XSD:positiveInteger";
    };
    
    type integer NonPositiveInteger (-infinity .. 0)
    with {
    variant "XSD:nonPositiveInteger";
    };
    
    type integer NegativeInteger (-infinity .. -1)
    with {
    variant "XSD:negativeInteger";
    };
    
    type integer NonNegativeInteger (0 .. infinity)
    with {
    variant "XSD:nonNegativeInteger";
    };
    
    type longlong Long
    with {
    variant "XSD:long";
    };
    
    type unsignedlonglong UnsignedLong
    with {
    variant "XSD:unsignedLong";
    };
    
    type long Int
    with {
    variant "XSD:int";
    };
    
    type unsignedlong UnsignedInt
    with {
    variant "XSD:unsignedInt";
    };
    
    type short Short
    with {
    variant "XSD:short";
    };
    
    type unsignedshort UnsignedShort
    with {
    variant "XSD:unsignedShort";
    };
    
    type byte Byte
    with {
    variant "XSD:byte";
    };
    
    type unsignedbyte UnsignedByte
    with {
    variant "XSD:unsignedByte";
    };
    
    // Float types
    
    type float Decimal
    with {
    variant "XSD:decimal";
    };
    
    type IEEE754float Float
    with {
    variant "XSD:float";
    };
    
    type IEEE754double Double
    with {
    variant "XSD:double";
    };
    
    // Time types
    
    type charstring Duration (pattern
      "{dash}#(,1)P({nums}(Y({nums}(M({nums}D{durTime}#(,1)|{durTime}#(,1))|D{durTime}#(,1))|" &
      "{durTime}#(,1))|M({nums}D{durTime}#(,1)|{durTime}#(,1))|D{durTime}#(,1))|{durTime})")
    with {
    variant "XSD:duration";
    };
    
    type charstring DateTime (pattern
      "{yearExpansion}{year}{dash}{month}{dash}{dayOfMonth}T({hour}{cln}{minute}{cln}{second}" &
     "{sFraction}|{endOfDayExt}){ZorTimeZoneExt}" )
    with {
    variant "XSD:dateTime";
    };
    
    type charstring Time (pattern
      "({hour}{cln}{minute}{cln}{second}{sFraction}|{endOfDayExt}){ZorTimeZoneExt}" )
    with {
    variant "XSD:time";
    };
    
    type charstring Date (pattern
      "{yearExpansion}{year}{dash}{month}{dash}{dayOfMonth}{ZorTimeZoneExt}" )
    with {
    variant "XSD:date";
    };
    
    type charstring GYearMonth (pattern
      "{yearExpansion}{year}{dash}{month}{ZorTimeZoneExt}" )
    with {
    variant "XSD:gYearMonth";
    };
    
    type charstring GYear (pattern
      "{yearExpansion}{year}{ZorTimeZoneExt}" )
    with {
    variant "XSD:gYear";
    };
    
    type charstring GMonthDay (pattern
     "{dash}{dash}{month}{dash}{dayOfMonth}{ZorTimeZoneExt}" )
    with {
    variant "XSD:gMonthDay";
    };
    
    type charstring GDay (pattern
      "{dash}{dash}{dash}{dayOfMonth}{ZorTimeZoneExt}" )
    with {
    variant "XSD:gDay";
    };
    
    type charstring GMonth (pattern
      "{dash}{dash}{month}{ZorTimeZoneExt}" )
    with {
    variant "XSD:gMonth";
    };
    
    // Sequence types
    
    type record of NMTOKEN NMTOKENS
    with {
    variant "XSD:NMTOKENS";
    };
    
    type record of IDREF IDREFS
    with {
    variant "XSD:IDREFS";
    };
    
    type record of ENTITY ENTITIES
    with {
    variant "XSD:ENTITIES";
    };
    
    type record QName
    {
    	AnyURI uri  optional,
    	NCName name
    }
    with {
    variant "XSD:QName";
    };
    
    // Boolean type
    
    type boolean Boolean
    with {
    variant "XSD:boolean";
    };
    
    //TTCN-3 type definitions supporting the mapping of W3C XML Schema built-in datatypes
    
    type utf8string XMLCompatibleString
    (
    	char(0,0,0,9)..char(0,0,0,9),
    	char(0,0,0,10)..char(0,0,0,10),
    	char(0,0,0,13)..char(0,0,0,13),
      	char(0,0,0,32)..char(0,0,215,255),
      	char(0,0,224,0)..char(0,0,255,253),
      	char(0,1,0,0)..char(0,16,255,253)
    );
    
    type utf8string XMLStringWithNoWhitespace
    (
    	char(0,0,0,33)..char(0,0,215,255),
      	char(0,0,224,0)..char(0,0,255,253),
      	char(0,1,0,0)..char(0,16,255,253)
    );
    
    type utf8string XMLStringWithNoCRLFHT
    (
    	char(0,0,0,32)..char(0,0,215,255),
     	char(0,0,224,0)..char(0,0,255,253),
      	char(0,1,0,0)..char(0,16,255,253)
    );
    
    }
    with{
    encode "XML"
    }