XML_Policy

The XML policy structure is defined in file include/mcoxml.h as follows:

     
    typedef struct mco_xml_policy_t_
    {
        MCO_NUM_BASE      int_base;
        MCO_NUM_BASE      quad_base;
        MCO_TEXT_CODING   text_coding;
        MCO_TEXT_CODING   blob_coding;
        MCO_FLOAT_FORMAT  float_format;
        mco_bool  indent;
        mco_bool  ignore_field;  /* ignore field in xml that is not in class */
        mco_bool  encode_spec;   /* encode chars with code < 32, except LF */
        mco_bool  encode_lf;     /* encode line feeds */
        mco_bool  encode_nat;    /* encode national chars (code > 127) */
        mco_bool  truncate_sp;   /* truncate trailing spaces in chars */
        mco_bool  use_xml_attrs; /* alternative XML representation, using */
        /* attributes */
        mco_bool ignore_autoid;  /* ignore autoid value in create operations  */
        mco_bool ignore_autooid; /* ignore auto_oid in create operations  */
     
    } mco_xml_policy_t;
     

The allowed values for MCO_NUM_BASE, MCO_TEXT_CODING, and MCO_FLOAT_FORMAT are defined as follows:

     
    typedef enum MCO_NUM_BASE_E
    {
        MCO_NUM_OCT =  8,
        MCO_NUM_DEC = 10,
        MCO_NUM_HEX = 16
     
    } MCO_NUM_BASE;
     
    typedef enum MCO_TEXT_CODING_E
    {
        MCO_TEXT_ASCII  = 1,
        MCO_TEXT_BINHEX = 2,
        MCO_TEXT_BASE64 = 3
     
    } MCO_TEXT_CODING;
     
    typedef enum MCO_FLOAT_FORMAT_E
    {
        MCO_FLOAT_FIXED    = 1,
        MCO_FLOAT_EXPONENT = 2
     
    } MCO_FLOAT_FORMAT;
     

The policy default values are set as follows:

 
    static mco_xml_policy_t default_xml_policy = 
    {
        MCO_NUM_DEC,        /* int_base is decimal             */
        MCO_NUM_HEX,        /* quad_base is hexadecimal        */
        MCO_TEXT_ASCII,     /* text_coding (strings) are ASCII */
        MCO_TEXT_BASE64,    /* blob_coding is Base64           */
        MCO_FLOAT_EXPONENT, /* float_format is exponential     */
        MCO_YES,            /* text is indented                */
        MCO_NO,             /* all fields must be present in   */
        /* the incoming XML                */
        MCO_YES,            /* encode special chars  (< 32)    */
        MCO_YES,            /* encode line feeds               */
        MCO_NO,             /* encode national chars (> 127)   */
        MCO_YES             /* truncate trailing spaces        */
        MCO_NO,             /* don't use attributes            */
        MCO_YES,            /* ignore autoid values in input   */
        MCO_YES             /* ignore autooid values in input  */
    };