Liquid XML Data Binder (C++, Java, VB6) / Reference / C# and VB .Net (Deprecated - use Liquid XML Objects) / Reference / SerializationContext / FIContext / DataTypes
In This Topic
    In This Topic
    This feature has been superseded by Liquid XML Objects.
    (The original functionality is still included in the product)
    Use Liquid XML Objects
    EncodedCharacterString DataTypes[ITEM_TYPE_MAX]
      Property Description  
        Property Name DataTypes  
        Property Type EncodedCharacterString  
        Accessors None  
        Description Allows you to set the Fast Infoset Encoding for each Xml Data Type.  

    DataTypes is an array of EncodedCharacterString structures, each representing an Xml Data Type. The values used to index into the array are defined in the global ItemType enum as follows:

    enum Conversions.ConversionType
        type_hexBinary = 0,

    So the EncodedCharacterString structure stored at DataTypes[ItemType_i4] represents the encoding method for all i4 Xml Data Type values within the Fast Infoset document.

    EncodedCharacterString is a structure defined as follows:

    struct EncodedCharacterString
        EncodedCharacterType encodedCharacterType; // EncodedCharacterType_Default has no index
        int index;

    Each EncodedCharacterString has an encodedCharacterType and a index value. The encodedCharacterType is an enum defined as follows:

    enum EncodedCharacterType
        EncodedCharacterType_Default, //UTF8 or UTF16BE depending on DefaultStringEncoding

    The encodedCharacterType represents the type of encoding to be applied, whilst the index represents which encoding of the selected type to use.

    The Default value in EncodedCharacterString for all data types is EncodedCharacterType_Default which uses no encoding, so the index is not used.

    Setting the encodedCharacterType to EncodedCharacterType_RestrictedTypes allows you to set index to one of the following encoding values:


    Setting the encodedCharacterType to EncodedCharacterType_EncodingAlgorithm allows you to set dwIndex to one of the following encoding values:

    FastInfosetConsts.ENCODING_ALGORITHM_BASE64 = 2;
    FastInfosetConsts.ENCODING_ALGORITHM_SHORT = 3;
    FastInfosetConsts.ENCODING_ALGORITHM_INT = 4;
    FastInfosetConsts.ENCODING_ALGORITHM_LONG = 5;
    FastInfosetConsts.ENCODING_ALGORITHM_FLOAT = 7;
    FastInfosetConsts.ENCODING_ALGORITHM_DOUBLE = 8;
    FastInfosetConsts.ENCODING_ALGORITHM_UUID = 9;
    FastInfosetConsts.ENCODING_ALGORITHM_CDATA = 10;

    The SuggestedValues method explains the suggested encoding combinations for each Xml Data Type.

    Example: Setting the Fast Infoset Encoding for all i4 Xml Data Types to use the Fast Infoset built in Numeric Restricted Alphabet.

    SerializationContext context = SerializationContext.Default;
    FastInfosetContext fiContext = context.FIContext();

    fiContext.DataTypes[(int)Conversions.ConversionType.type_i4].encodedCharacterType = EncodedCharacterType.EncodedCharacterType_RestrictedTypes;
    fiContext.DataTypes[(int)Conversions.ConversionType.type_i4].index = FastInfosetConsts.RESTRICTED_ALPHABET_NUMERIC;