class element_a { 
  bit(1) has_id;
  if (has_id) {
    attr_custom_ID id;
  }
  bit(1) has_rare;
  if (has_rare) {
    attr_custom_rare rare;
  }
  bit(1) has_fill;
  if (has_fill) {
    attr_custom_paint fill;
  }
  bit(1) has_stroke;
  if (has_stroke) {
    attr_custom_paint stroke;
  }
  bit(1) externalResourcesRequired;
  bit(1) has_target;
  if (has_target) {
    attr_custom_byteAlignedString target;
  }
  bit(1) has_href;
  if (has_href) {
    attr_custom_anyURI href;
  }
  bit(1) has_attr_any;
  if (has_attr_any) {
    attr_any any;
  }
  object_content child0;
}
class privateAttributeContainer {
  bit(4) codePoint;
  switch(codePoint){
    case 0:
      privateAnyXMLAttribute anyXML;
      break;
    case 1:
      privateOpaqueAttribute opaque;
      break;
    case 2:
      attr_any reserved;
      break;
    default:
      attr_custom_extension ext;
      break;
    }
}
class elements {
  bit(6) ch4;
  switch(ch4){
    case 0:
      element_a a;
      break;
    case 1:
      element_animate animate;
      break;
    case 2:
      element_animate animateColor;
      break;
    case 3:
      element_animateMotion animateMotion;
      break;
    case 4:
      element_animateTransform animateTransform;
      break;
    case 5:
      element_audio audio;
      break;
    case 6:
      element_circle circle;
      break;
    case 7:
      element_defs defs;
      break;
    case 8:
      element_desc_metaData_title desc;
      break;
    case 9:
      element_ellipse ellipse;
      break;
    case 10:
      element_foreignObject foreignObject;
      break;
    case 11:
      element_g g;
      break;
    case 12:
      element_image image;
      break;
    case 13:
      element_line line;
      break;
    case 14:
      element_linearGradient linearGradient;
      break;
    case 15:
      element_desc_metaData_title metadata;
      break;
    case 16:
      element_mpath mpath;
      break;
    case 17:
      element_path path;
      break;
    case 18:
      element_polygon polygon;
      break;
    case 19:
      element_polygon polyline;
      break;
    case 20:
      element_radialGradient radialGradient;
      break;
    case 21:
      element_rect rect;
      break;
    case 22:
      element_sameg sameg;
      break;
    case 23:
      element_sameline sameline;
      break;
    case 24:
      element_samepath samepath;
      break;
    case 25:
      element_samepathfill samepathfill;
      break;
    case 26:
      element_samepolygon samepolygon;
      break;
    case 27:
      element_samepolygonfill samepolygonfill;
      break;
    case 28:
      element_samepolygonstroke samepolygonstroke;
      break;
    case 29:
      element_samepolygon samepolyline;
      break;
    case 30:
      element_samepolygonfill samepolylinefill;
      break;
    case 31:
      element_samepolygonstroke samepolylinestroke;
      break;
    case 32:
      element_samerect samerect;
      break;
    case 33:
      element_samerectfill samerectfill;
      break;
    case 34:
      element_sametext sametext;
      break;
    case 35:
      element_sametextfill sametextfill;
      break;
    case 36:
      element_sameuse sameuse;
      break;
    case 37:
      element_script script;
      break;
    case 38:
      element_set set;
      break;
    case 39:
      element_stop stop;
      break;
    case 40:
      element_switch switch;
      break;
    case 41:
      element_text text;
      break;
    case 42:
      element_desc_metaData_title title;
      break;
    case 43:
      element_tspan tspan;
      break;
    case 44:
      element_use use;
      break;
    case 45:
      element_video video;
      break;
    case 46:
      element_listener listener;
      break;
    case 47:
      element_conditional conditional;
      break;
    case 48:
      element_cursorManager cursorManager;
      break;
    case 49:
      element_any extElement;
      break;
    case 50:
      privateElementContainer privateElementContainer;
      break;
    case 51:
      element_rectClip rectClip;
      break;
    case 52:
      element_selector selector;
      break;
    case 53:
      element_simpleLayout simpleLayout;
      break;
    case 54:
      attr_custom_byteAlignedString textContent;
      break;
    }
}
class element_animate {
  bit(1) has_id;
  if (has_id) {
    attr_custom_ID id;
  }
  bit(1) has_rare;
  if (has_rare) {
    attr_custom_rare rare;
  }
  bit(1) has_attributeName;
  if (has_attributeName) {
    attr_AttributeName attributeName;
  }
  bit(1) has_accumulate;
  if (has_accumulate) {
    attr_accumulate accumulate;
  }
  bit(1) has_additive;
  if (has_additive) {
    attr_additive additive;
  }
  bit(1) has_by;
  if (has_by) {
    attr_custom_AnimatedValue by;
  }
  bit(1) has_calcMode;
  if (has_calcMode) {
    attr_calcMode calcMode;
  }
  bit(1) has_from;
  if (has_from) {
    attr_custom_AnimatedValue from;
  }
  bit(1) has_keySplines;
  if (has_keySplines) {
    attr_custom_fraction12List keySplines;
  }
  bit(1) has_keyTimes;
  if (has_keyTimes) {
    attr_custom_fraction12List keyTimes;
  }
  bit(1) has_values;
  if (has_values) {
    attr_custom_AnimatedValues values;
  }
  bit(1) has_attributeType;
  if (has_attributeType) {
    attr_attributeType attributeType;
  }
  bit(1) has_begin;
  if (has_begin) {
    attr_smil_times begin;
  }
  bit(1) has_dur;
  if (has_dur) {
    attr_time dur;
  }
  bit(1) has_fill;
  if (has_fill) {
    attr_animFill fill;
  }
  bit(1) has_repeatCount;
  if (has_repeatCount) {
    attr_repeatCount repeatCount;
  }
  bit(1) has_repeatDur;
  if (has_repeatDur) {
    attr_repeatDur repeatDur;
  }
  bit(1) has_restart;
  if (has_restart) {
    attr_restart restart;
  }
  bit(1) has_to;
  if (has_to) {
    attr_custom_AnimatedValue to;
  }
  bit(1) has_href;
  if (has_href) {
    attr_custom_anyURI href;
  }
  bit(1) enabled;
  bit(1) has_attr_any;
  if (has_attr_any) {
    attr_any any;
  }
  object_content child0;
}
class element_animateMotion {
  bit(1) has_id;
  if (has_id) {
    attr_custom_ID id;
  }
  bit(1) has_rare;
  if (has_rare) {
    attr_custom_rare rare;
  }
  bit(1) has_accumulate;
  if (has_accumulate) {
    attr_accumulate accumulate;
  }
  bit(1) has_additive;
  if (has_additive) {
    attr_additive additive;
  }
  bit(1) has_by;
  if (has_by) {
    attr_custom_AnimatedValue by;
  }
  bit(1) has_calcMode;
  if (has_calcMode) {
    attr_calcMode calcMode;
  }
  bit(1) has_from;
  if (has_from) {
    attr_custom_AnimatedValue from;
  }
  bit(1) has_keySplines;
  if (has_keySplines) {
    attr_custom_fraction12List keySplines;
  }
  bit(1) has_keyTimes;
  if (has_keyTimes) {
    attr_custom_fraction12List keyTimes;
  }
  bit(1) has_values;
  if (has_values) {
    attr_custom_AnimatedValues values;
  }
  bit(1) has_attributeType;
  if (has_attributeType) {
    attr_attributeType attributeType;
  }
  bit(1) has_begin;
  if (has_begin) {
    attr_smil_times begin;
  }
  bit(1) has_dur;
  if (has_dur) {
    attr_time dur;
  }
  bit(1) has_fill;
  if (has_fill) {
    attr_animFill fill;
  }
  bit(1) has_repeatCount;
  if (has_repeatCount) {
    attr_repeatCount repeatCount;
  }
  bit(1) has_repeatDur;
  if (has_repeatDur) {
    attr_repeatDur repeatDur;
  }
  bit(1) has_restart;
  if (has_restart) {
    attr_restart restart;
  }
  bit(1) has_to;
  if (has_to) {
    attr_custom_AnimatedValue to;
  }
  bit(1) has_keyPoints;
  if (has_keyPoints) {
    attr_floatList keyPoints;
  }
  bit(1) has_path;
  if (has_path) {
    attr_custom_path path;
  }
  bit(1) has_rotate;
  if (has_rotate) {
    attr_rotate rotate;
  }
  bit(1) has_href;
  if (has_href) {
    attr_custom_anyURI href;
  }
  bit(1) enabled;
  bit(1) has_attr_any;
  if (has_attr_any) {
    attr_any any;
  }
  object_content child0;
}
class element_animateTransform {
  bit(1) has_id;
  if (has_id) {
    attr_custom_ID id;
  }
  bit(1) has_rare;
  if (has_rare) {
    attr_custom_rare rare;
  }
  bit(1) has_attributeName;
  if (has_attributeName) {
    attr_AttributeName attributeName;
  }
  attr_rotscatra type;
  bit(1) has_accumulate;
  if (has_accumulate) {
    attr_accumulate accumulate;
  }
  bit(1) has_additive;
  if (has_additive) {
    attr_additive additive;
  }
  bit(1) has_by;
  if (has_by) {
    attr_custom_AnimatedValue by;
  }
  bit(1) has_calcMode;
  if (has_calcMode) {
    attr_calcMode calcMode;
  }
  bit(1) has_from;
  if (has_from) {
    attr_custom_AnimatedValue from;
  }
  bit(1) has_keySplines;
  if (has_keySplines) {
    attr_custom_fraction12List keySplines;
  }
  bit(1) has_keyTimes;
  if (has_keyTimes) {
    attr_custom_fraction12List keyTimes;
  }
  bit(1) has_values;
  if (has_values) {
    attr_custom_AnimatedValues values;
  }
  bit(1) has_attributeType;
  if (has_attributeType) {
    attr_attributeType attributeType;
  }
  bit(1) has_begin;
  if (has_begin) {
    attr_smil_times begin;
  }
  bit(1) has_dur;
  if (has_dur) {
    attr_time dur;
  }
  bit(1) has_fill;
  if (has_fill) {
    attr_animFill fill;
  }
  bit(1) has_repeatCount;
  if (has_repeatCount) {
    attr_repeatCount repeatCount;
  }
  bit(1) has_repeatDur;
  if (has_repeatDur) {
    attr_repeatDur repeatDur;
  }
  bit(1) has_restart;
  if (has_restart) {
    attr_restart restart;
  }
  bit(1) has_to;
  if (has_to) {
    attr_custom_AnimatedValue to;
  }
  bit(1) has_href;
  if (has_href) {
    attr_custom_anyURI href;
  }
  bit(1) enabled;
  bit(1) has_attr_any;
  if (has_attr_any) {
    attr_any any;
  }
  object_content child0;
}
class element_audio {
  bit(1) has_id;
  if (has_id) {
    attr_custom_ID id;
  }
  bit(1) has_rare;
  if (has_rare) {
    attr_custom_rare rare;
  }
  bit(1) has_begin;
  if (has_begin) {
    attr_smil_times begin;
  }
  bit(1) has_dur;
  if (has_dur) {
    attr_time dur;
  }
  bit(1) externalResourcesRequired;
  bit(1) has_repeatCount;
  if (has_repeatCount) {
    attr_repeatCount repeatCount;
  }
  bit(1) has_repeatDur;
  if (has_repeatDur) {
    attr_repeatDur repeatDur;
  }
  bit(1) has_restart;
  if (has_restart) {
    attr_restart restart;
  }
  bit(1) has_syncBehavior;
  if (has_syncBehavior) {
    attr_syncBehavior syncBehavior;
  }
  bit(1) has_syncTolerance;
  if (has_syncTolerance) {
    attr_syncTolerance syncTolerance;
  }
  bit(1) has_type;
  if (has_type) {
    attr_custom_byteAlignedString type;
  }
  bit(1) has_href;
  if (has_href) {
    attr_custom_anyURI href;
  }
  bit(1) has_clipBegin;
  if (has_clipBegin) {
    attr_time clipBegin;
  }
  bit(1) has_clipEnd;
  if (has_clipEnd) {
    attr_time clipEnd;
  }
  bit(1) has_syncReference;
  if (has_syncReference) {
    attr_custom_anyURI syncReference;
  }
  bit(1) has_attr_any;
  if (has_attr_any) {
    attr_any any;
  }
  object_content child0;
}
class element_circle {
  bit(1) has_id;
  if (has_id) {
    attr_custom_ID id;
  }
  bit(1) has_rare;
  if (has_rare) {
    attr_custom_rare rare;
  }
  bit(1) has_fill;
  if (has_fill) {
    attr_custom_paint fill;
  }
  bit(1) has_stroke;
  if (has_stroke) {
    attr_custom_paint stroke;
  }
  bit(1) has_cx;
  if (has_cx) {
    attr_custom_coordinate cx;
  }
  bit(1) has_cy;
  if (has_cy) {
    attr_custom_coordinate cy;
  }
  attr_custom_coordinate r;
  bit(1) has_attr_any;
  if (has_attr_any) {
    attr_any any;
  }
  object_content child0;
}
class element_defs {
  bit(1) has_id;
  if (has_id) {
    attr_custom_ID id;
  }
  bit(1) has_rare;
  if (has_rare) {
    attr_custom_rare rare;
  }
  bit(1) has_fill;
  if (has_fill) {
    attr_custom_paint fill;
  }
  bit(1) has_stroke;
  if (has_stroke) {
    attr_custom_paint stroke;
  }
  bit(1) has_attr_any;
  if (has_attr_any) {
    attr_any any;
  }
  object_content child0;
}
class element_desc_metaData_title {
  bit(1) has_id;
  if (has_id) {
    attr_custom_ID id;
  }
  bit(1) has_rare;
  if (has_rare) {
    attr_custom_rare rare;
  }
  bit(1) has_attr_any;
  if (has_attr_any) {
    attr_any any;
  }
  object_content child0;
}
class element_ellipse {
  bit(1) has_id;
  if (has_id) {
    attr_custom_ID id;
  }
  bit(1) has_rare;
  if (has_rare) {
    attr_custom_rare rare;
  }
  bit(1) has_fill;
  if (has_fill) {
    attr_custom_paint fill;
  }
  bit(1) has_stroke;
  if (has_stroke) {
    attr_custom_paint stroke;
  }
  bit(1) has_cx;
  if (has_cx) {
    attr_custom_coordinate cx;
  }
  bit(1) has_cy;
  if (has_cy) {
    attr_custom_coordinate cy;
  }
  attr_custom_coordinate rx;
  attr_custom_coordinate ry;
  bit(1) has_attr_any;
  if (has_attr_any) {
    attr_any any;
  }
  object_content child0;
}
class element_foreignObject {
  bit(1) has_id;
  if (has_id) {
    attr_custom_ID id;
  }
  bit(1) has_rare;
  if (has_rare) {
    attr_custom_rare rare;
  }
  bit(1) has_fill;
  if (has_fill) {
    attr_custom_paint fill;
  }
  bit(1) has_stroke;
  if (has_stroke) {
    attr_custom_paint stroke;
  }
  bit(1) externalResourcesRequired;
  attr_custom_coordinate height;
  attr_custom_coordinate width;
  bit(1) has_x;
  if (has_x) {
    attr_custom_coordinate x;
  }
  bit(1) has_y;
  if (has_y) {
    attr_custom_coordinate y;
  }
  bit(1) has_href;
  if (has_href) {
    attr_custom_anyURI href;
  }
  bit(1) has_attr_any;
  if (has_attr_any) {
    attr_any any;
  }
  bit(1) opt_group;
  if (opt_group) {
    vluimsbf5 occ1;
    for(int t=0;t<occ1;t++) {
      privateElementContainer child0[[t]];
    }
  }
}
class element_g {
  bit(1) has_id;
  if (has_id) {
    attr_custom_ID id;
  }
  bit(1) has_rare;
  if (has_rare) {
    attr_custom_rare rare;
  }
  bit(1) has_fill;
  if (has_fill) {
    attr_custom_paint fill;
  }
  bit(1) has_stroke;
  if (has_stroke) {
    attr_custom_paint stroke;
  }
  bit(1) externalResourcesRequired;
  bit(1) has_attr_any;
  if (has_attr_any) {
    attr_any any;
  }
  object_content child0;
}
class element_image {
  bit(1) has_id;
  if (has_id) {
    attr_custom_ID id;
  }
  bit(1) has_rare;
  if (has_rare) {
    attr_custom_rare rare;
  }
  bit(1) externalResourcesRequired;
  bit(1) has_height;
  if (has_height) {
    attr_custom_coordinate height;
  }
  bit(1) has_opacity;
  if (has_opacity) {
    attr_custom_0to1float opacity;
  }
  bit(1) has_preserveAspectRatio;
  if (has_preserveAspectRatio) {
    attr_preserveAspectRatio preserveAspectRatio;
  }
  bit(1) has_type;
  if (has_type) {
    attr_custom_byteAlignedString type;
  }
  bit(1) has_width;
  if (has_width) {
    attr_custom_coordinate width;
  }
  bit(1) has_x;
  if (has_x) {
    attr_custom_coordinate x;
  }
  bit(1) has_y;
  if (has_y) {
    attr_custom_coordinate y;
  }
  bit(1) has_href;
  if (has_href) {
    attr_custom_anyURI href;
  }
  bit(1) has_transformBehavior;
  if (has_transformBehavior) {
    attr_transformBehavior transformBehavior;
  }
  bit(1) has_attr_any;
  if (has_attr_any) {
    attr_any any;
  }
  object_content child0;
}
class element_line {
  bit(1) has_id;
  if (has_id) {
    attr_custom_ID id;
  }
  bit(1) has_rare;
  if (has_rare) {
    attr_custom_rare rare;
  }
  bit(1) has_fill;
  if (has_fill) {
    attr_custom_paint fill;
  }
  bit(1) has_stroke;
  if (has_stroke) {
    attr_custom_paint stroke;
  }
  bit(1) has_x1;
  if (has_x1) {
    attr_custom_coordinate x1;
  }
  attr_custom_coordinate x2;
  bit(1) has_y1;
  if (has_y1) {
    attr_custom_coordinate y1;
  }
  attr_custom_coordinate y2;
  bit(1) has_attr_any;
  if (has_attr_any) {
    attr_any any;
  }
  object_content child0;
}
class element_linearGradient {
  bit(1) has_id;
  if (has_id) {
    attr_custom_ID id;
  }
  bit(1) has_rare;
  if (has_rare) {
    attr_custom_rare rare;
  }
  bit(1) has_fill;
  if (has_fill) {
    attr_custom_paint fill;
  }
  bit(1) has_stroke;
  if (has_stroke) {
    attr_custom_paint stroke;
  }
  bit(1) has_gradientUnits;
  if (has_gradientUnits) {
    attr_gradientUnits gradientUnits;
  }
  bit(1) has_x1;
  if (has_x1) {
    attr_custom_coordinate x1;
  }
  bit(1) has_x2;
  if (has_x2) {
    attr_custom_coordinate x2;
  }
  bit(1) has_y1;
  if (has_y1) {
    attr_custom_coordinate y1;
  }
  bit(1) has_y2;
  if (has_y2) {
    attr_custom_coordinate y2;
  }
  bit(1) has_attr_any;
  if (has_attr_any) {
    attr_any any;
  }
  object_content child0;
}
class element_mpath {
  bit(1) has_id;
  if (has_id) {
    attr_custom_ID id;
  }
  bit(1) has_rare;
  if (has_rare) {
    attr_custom_rare rare;
  }
  bit(1) has_href;
  if (has_href) {
    attr_custom_anyURI href;
  }
  bit(1) has_attr_any;
  if (has_attr_any) {
    attr_any any;
  }
  object_content child0;
}
class element_path {
  bit(1) has_id;
  if (has_id) {
    attr_custom_ID id;
  }
  bit(1) has_rare;
  if (has_rare) {
    attr_custom_rare rare;
  }
  bit(1) has_fill;
  if (has_fill) {
    attr_custom_paint fill;
  }
  bit(1) has_stroke;
  if (has_stroke) {
    attr_custom_paint stroke;
  }
  attr_custom_path d;
  bit(1) has_pathLength;
  if (has_pathLength) {
    attr_custom_fixed_16_8 pathLength;
  }
  bit(1) has_attr_any;
  if (has_attr_any) {
    attr_any any;
  }
  object_content child0;
}
class element_polygon {
  bit(1) has_id;
  if (has_id) {
    attr_custom_ID id;
  }
  bit(1) has_rare;
  if (has_rare) {
    attr_custom_rare rare;
  }
  bit(1) has_fill;
  if (has_fill) {
    attr_custom_paint fill;
  }
  bit(1) has_stroke;
  if (has_stroke) {
    attr_custom_paint stroke;
  }
  attr_custom_pointSequence points;
  bit(1) has_attr_any;
  if (has_attr_any) {
    attr_any any;
  }
  object_content child0;
}
class element_radialGradient {
  bit(1) has_id;
  if (has_id) {
    attr_custom_ID id;
  }
  bit(1) has_rare;
  if (has_rare) {
    attr_custom_rare rare;
  }
  bit(1) has_fill;
  if (has_fill) {
    attr_custom_paint fill;
  }
  bit(1) has_stroke;
  if (has_stroke) {
    attr_custom_paint stroke;
  }
  bit(1) has_cx;
  if (has_cx) {
    attr_custom_coordinate cx;
  }
  bit(1) has_cy;
  if (has_cy) {
    attr_custom_coordinate cy;
  }
  bit(1) has_gradientUnits;
  if (has_gradientUnits) {
    attr_gradientUnits gradientUnits;
  }
  bit(1) has_r;
  if (has_r) {
    attr_custom_coordinate r;
  }
  bit(1) has_attr_any;
  if (has_attr_any) {
    attr_any any;
  }
  object_content child0;
}
class element_rect {
  bit(1) has_id;
  if (has_id) {
    attr_custom_ID id;
  }
  bit(1) has_rare;
  if (has_rare) {
    attr_custom_rare rare;
  }
  bit(1) has_fill;
  if (has_fill) {
    attr_custom_paint fill;
  }
  bit(1) has_stroke;
  if (has_stroke) {
    attr_custom_paint stroke;
  }
  attr_custom_coordinate height;
  bit(1) has_rx;
  if (has_rx) {
    attr_custom_coordinate rx;
  }
  bit(1) has_ry;
  if (has_ry) {
    attr_custom_coordinate ry;
  }
  attr_custom_coordinate width;
  bit(1) has_x;
  if (has_x) {
    attr_custom_coordinate x;
  }
  bit(1) has_y;
  if (has_y) {
    attr_custom_coordinate y;
  }
  bit(1) has_attr_any;
  if (has_attr_any) {
    attr_any any;
  }
  object_content child0;
}
class element_sameg {
  bit(1) has_id;
  if (has_id) {
    attr_custom_ID id;
  }
  objectSame_content child0;
}
class element_sameline {
  bit(1) has_id;
  if (has_id) {
    attr_custom_ID id;
  }
  bit(1) has_x1;
  if (has_x1) {
    attr_custom_coordinate x1;
  }
  attr_custom_coordinate x2;
  bit(1) has_y1;
  if (has_y1) {
    attr_custom_coordinate y1;
  }
  attr_custom_coordinate y2;
  objectSame_content child0;
}
class element_samepath {
  bit(1) has_id;
  if (has_id) {
    attr_custom_ID id;
  }
  attr_custom_path d;
  objectSame_content child0;
}
class element_samepathfill {
  bit(1) has_id;
  if (has_id) {
    attr_custom_ID id;
  }
  bit(1) has_fill;
  if (has_fill) {
    attr_custom_paint fill;
  }
  attr_custom_path d;
  objectSame_content child0;
}
class element_samepolygon {
  bit(1) has_id;
  if (has_id) {
    attr_custom_ID id;
  }
  attr_custom_pointSequence points;
  objectSame_content child0;
}
class element_samepolygonfill {
  bit(1) has_id;
  if (has_id) {
    attr_custom_ID id;
  }
  bit(1) has_fill;
  if (has_fill) {
    attr_custom_paint fill;
  }
  attr_custom_pointSequence points;
  objectSame_content child0;
}
class element_samepolygonstroke {
  bit(1) has_id;
  if (has_id) {
    attr_custom_ID id;
  }
  bit(1) has_stroke;
  if (has_stroke) {
    attr_custom_paint stroke;
  }
  attr_custom_pointSequence points;
  objectSame_content child0;
}
class element_samerect {
  bit(1) has_id;
  if (has_id) {
    attr_custom_ID id;
  }
  attr_custom_coordinate height;
  attr_custom_coordinate width;
  bit(1) has_x;
  if (has_x) {
    attr_custom_coordinate x;
  }
  bit(1) has_y;
  if (has_y) {
    attr_custom_coordinate y;
  }
  objectSame_content child0;
}
class element_samerectfill {
  bit(1) has_id;
  if (has_id) {
    attr_custom_ID id;
  }
  bit(1) has_fill;
  if (has_fill) {
    attr_custom_paint fill;
  }
  attr_custom_coordinate height;
  attr_custom_coordinate width;
  bit(1) has_x;
  if (has_x) {
    attr_custom_coordinate x;
  }
  bit(1) has_y;
  if (has_y) {
    attr_custom_coordinate y;
  }
  objectSame_content child0;
}
class element_sametext {
  bit(1) has_id;
  if (has_id) {
    attr_custom_ID id;
  }
  bit(1) has_x;
  if (has_x) {
    attr_coordinateList x;
  }
  bit(1) has_y;
  if (has_y) {
    attr_coordinateList y;
  }
  objectSame_content child0;
}
class element_sametextfill {
  bit(1) has_id;
  if (has_id) {
    attr_custom_ID id;
  }
  bit(1) has_fill;
  if (has_fill) {
    attr_custom_paint fill;
  }
  bit(1) has_x;
  if (has_x) {
    attr_coordinateList x;
  }
  bit(1) has_y;
  if (has_y) {
    attr_coordinateList y;
  }
  objectSame_content child0;
}
class element_sameuse {
  bit(1) has_id;
  if (has_id) {
    attr_custom_ID id;
  }
  bit(1) has_href;
  if (has_href) {
    attr_custom_anyURI href;
  }
  objectSame_content child0;
}
class element_script {
  bit(1) has_id;
  if (has_id) {
    attr_custom_ID id;
  }
  bit(1) has_rare;
  if (has_rare) {
    attr_custom_rare rare;
  }
  bit(1) externalResourcesRequired;
  bit(1) has_type;
  if (has_type) {
      attr_script type;
  }
  bit(1) has_href;
  if (has_href) {
    attr_custom_anyURI href;
  }
  bit(1) has_attr_any;
  if (has_attr_any) {
    attr_any any;
  }
  object_content child0;
}
class element_set {
  bit(1) has_id;
  if (has_id) {
    attr_custom_ID id;
  }
  bit(1) has_rare;
  if (has_rare) {
    attr_custom_rare rare;
  }
  bit(1) has_attributeName;
  if (has_attributeName) {
    attr_AttributeName attributeName;
  }
  bit(1) has_attributeType;
  if (has_attributeType) {
    attr_attributeType attributeType;
  }
  bit(1) has_begin;
  if (has_begin) {
    attr_smil_times begin;
  }
  bit(1) has_dur;
  if (has_dur) {
    attr_time dur;
  }
  bit(1) has_fill;
  if (has_fill) {
    attr_animFill fill;
  }
  bit(1) has_repeatCount;
  if (has_repeatCount) {
    attr_repeatCount repeatCount;
  }
  bit(1) has_repeatDur;
  if (has_repeatDur) {
    attr_repeatDur repeatDur;
  }
  bit(1) has_restart;
  if (has_restart) {
    attr_restart restart;
  }
  bit(1) has_to;
  if (has_to) {
    attr_custom_AnimatedValue to;
  }
  bit(1) has_href;
  if (has_href) {
    attr_custom_anyURI href;
  }
  bit(1) enabled;
  bit(1) has_attr_any;
  if (has_attr_any) {
    attr_any any;
  }
  object_content child0;
}
class element_stop {
  bit(1) has_id;
  if (has_id) {
    attr_custom_ID id;
  }
  bit(1) has_rare;
  if (has_rare) {
    attr_custom_rare rare;
  }
  bit(1) has_fill;
  if (has_fill) {
    attr_custom_paint fill;
  }
  bit(1) has_stroke;
  if (has_stroke) {
    attr_custom_paint stroke;
  }
  attr_custom_fixed_16_8 offset;
  bit(1) has_attr_any;
  if (has_attr_any) {
    attr_any any;
  }
  object_content child0;
}
class element_switch {
  bit(1) has_id;
  if (has_id) {
    attr_custom_ID id;
  }
  bit(1) has_rare;
  if (has_rare) {
    attr_custom_rare rare;
  }
  bit(1) has_fill;
  if (has_fill) {
    attr_custom_paint fill;
  }
  bit(1) has_stroke;
  if (has_stroke) {
    attr_custom_paint stroke;
  }
  bit(1) externalResourcesRequired;
  bit(1) has_attr_any;
  if (has_attr_any) {
    attr_any any;
  }
  object_content child0;
}
class element_text {
  bit(1) has_id;
  if (has_id) {
    attr_custom_ID id;
  }
  bit(1) has_rare;
  if (has_rare) {
    attr_custom_rare rare;
  }
  bit(1) has_fill;
  if (has_fill) {
    attr_custom_paint fill;
  }
  bit(1) has_stroke;
  if (has_stroke) {
    attr_custom_paint stroke;
  }
  attr_editable editable;
  bit(1) has_rotate;
  if (has_rotate) {
    attr_floatList rotate;
  }
  bit(1) has_x;
  if (has_x) {
    attr_coordinateList x;
  }
  bit(1) has_y;
  if (has_y) {
    attr_coordinateList y;
  }
  bit(1) has_attr_any;
  if (has_attr_any) {
    attr_any any;
  }
  object_content child0;
}
class element_tspan {
  bit(1) has_id;
  if (has_id) {
    attr_custom_ID id;
  }
  bit(1) has_rare;
  if (has_rare) {
    attr_custom_rare rare;
  }
  bit(1) has_fill;
  if (has_fill) {
    attr_custom_paint fill;
  }
  bit(1) has_stroke;
  if (has_stroke) {
    attr_custom_paint stroke;
  }
  bit(1) has_attr_any;
  if (has_attr_any) {
    attr_any any;
  }
  object_content child0;
}
class element_use {
  bit(1) has_id;
  if (has_id) {
    attr_custom_ID id;
  }
  bit(1) has_rare;
  if (has_rare) {
    attr_custom_rare rare;
  }
  bit(1) has_fill;
  if (has_fill) {
    attr_custom_paint fill;
  }
  bit(1) has_stroke;
  if (has_stroke) {
    attr_custom_paint stroke;
  }
  bit(1) externalResourcesRequired;
  bit(1) has_overflow;
  if (has_overflow) {
    attr_overflow overflow;
  }
  bit(1) has_x;
  if (has_x) {
    attr_custom_coordinate x;
  }
  bit(1) has_y;
  if (has_y) {
    attr_custom_coordinate y;
  }
  bit(1) has_href;
  if (has_href) {
    attr_custom_anyURI href;
  }
  bit(1) has_attr_any;
  if (has_attr_any) {
    attr_any any;
  }
  object_content child0;
}
class element_video {
  bit(1) has_id;
  if (has_id) {
    attr_custom_ID id;
  }
  bit(1) has_rare;
  if (has_rare) {
    attr_custom_rare rare;
  }
  bit(1) has_begin;
  if (has_begin) {
    attr_smil_times begin;
  }
  bit(1) has_dur;
  if (has_dur) {
    attr_time dur;
  }
  bit(1) externalResourcesRequired;
  bit(1) has_height;
  if (has_height) {
    attr_custom_coordinate height;
  }
  bit(1) has_overlay;
  if (has_overlay) {
    attr_overlay overlay;
  }
  bit(1) has_preserveAspectRatio;
  if (has_preserveAspectRatio) {
    attr_preserveAspectRatio preserveAspectRatio;
  }
  bit(1) has_repeatCount;
  if (has_repeatCount) {
    attr_repeatCount repeatCount;
  }
  bit(1) has_repeatDur;
  if (has_repeatDur) {
    attr_repeatDur repeatDur;
  }
  bit(1) has_restart;
  if (has_restart) {
    attr_restart restart;
  }
  bit(1) has_syncBehavior;
  if (has_syncBehavior) {
    attr_syncBehavior syncBehavior;
  }
  bit(1) has_syncTolerance;
  if (has_syncTolerance) {
    attr_syncTolerance syncTolerance;
  }
  bit(1) has_transformBehavior;
  if (has_transformBehavior) {
    attr_transformBehavior transformBehavior;
  }
  bit(1) has_type;
  if (has_type) {
    attr_custom_byteAlignedString type;
  }
  bit(1) has_width;
  if (has_width) {
    attr_custom_coordinate width;
  }
  bit(1) has_x;
  if (has_x) {
    attr_custom_coordinate x;
  }
  bit(1) has_y;
  if (has_y) {
    attr_custom_coordinate y;
  }
  bit(1) has_href;
  if (has_href) {
    attr_custom_anyURI href;
  }
  bit(1) has_clipBegin;
  if (has_clipBegin) {
    attr_time clipBegin;
  }
  bit(1) has_clipEnd;
  if (has_clipEnd) {
    attr_time clipEnd;
  }
  bit(1) has_syncReference;
  if (has_syncReference) {
    attr_custom_anyURI syncReference;
  }
  bit(1) has_attr_any;
  if (has_attr_any) {
    attr_any any;
  }
  object_content child0;
}
class element_listener {
  bit(1) has_id;
  if (has_id) {
    attr_custom_ID id;
  }
  bit(1) has_rare;
  if (has_rare) {
    attr_custom_rare rare;
  }
  bit(1) has_defaultAction;
  if (has_defaultAction) {
    attr_defaultAction defaultAction;
  }
  bit(1) has_event;
  if (has_event) {
    attr_custom_event event;
  }
  bit(1) has_handler;
  if (has_handler) {
    attr_custom_anyURI handler;
  }
  bit(1) has_observer;
  if (has_observer) {
    attr_custom_IDREF observer;
  }
  attr_phase phase;
  bit(1) has_propagate;
  if (has_propagate) {
    attr_propagate propagate;
  }
  bit(1) has_target;
  if (has_target) {
    attr_custom_IDREF target;
  }
  bit(1) enabled;
  bit(1) has_attr_any;
  if (has_attr_any) {
    attr_any any;
  }
  object_content child0;
}
class element_conditional {
  bit(1) has_id;
  if (has_id) {
    attr_custom_ID id;
  }
  bit(1) has_rare;
  if (has_rare) {
    attr_custom_rare rare;
  }
  bit(1) has_begin;
  if (has_begin) {
    attr_smil_times begin;
  }
  bit(1) externalResourcesRequired;
  bit(1) enabled;
  bit(1) has_attr_any;
  if (has_attr_any) {
    attr_any any;
  }
  updateListType_content child0;
  bit(1) opt_group;
  if (opt_group) {
    privateAttributeContainer privateAttributes;
  }
}
class updateListType_content {
	vluimsbf5 encoding-length;
	attr_custom_align encoding-align-before;
	vluimsbf5 occ0;
	for(int t=0;t<occ0+1;t++) {
		updates child0;
	}
	attr_custom_align encoding-align-after;
}
class updates {
  bit(4) ch4;
  switch(ch4){
    case 0:
      update_Add Add;
      break;
    case 1:
      update_Clean Clean;
      break;
    case 2:
      update_Delete Delete;
      break;
    case 3:
      update_Insert Insert;
      break;
    case 4:
      update_NewScene NewScene;
      break;
    case 5:
      update_RefreshScene RefreshScene;
      break;
    case 6:
      update_Replace Replace;
      break;
    case 7:
      update_Restore Restore;
      break;
    case 8:
      update_Save Save;
      break;
    case 9:
      update_SendEvent SendEvent;
      break;
    case 10:
      update_any ext;
      break;
    case 11:
      attr_custom_byteAlignedString textContent;
      break;
    default:
      break;
    }
}
class update_Add {
  bit(1) has_attributeName;
  if (has_attributeName) {
    attr_AttributeName attributeName;
  }
  bit(1) has_operandAttribute;
  if (has_operandAttribute) {
    attr_AttributeName operandAttribute;
  }
  bit(1) has_operandElementId;
  if (has_operandElementId) {
    attr_custom_IDREF operandElementId;
  }
  attr_custom_IDREF ref;
  bit(1) has_value;
  if (has_value) {
    attr_custom_updateValue value;
  }
  bit(1) has_attr_any;
  if (has_attr_any) {
    attr_any any;
  }
}
class update_Clean {
  attr_custom_byteAlignedString groupID;
  bit(1) has_attr_any;
  if (has_attr_any) {
    attr_any any;
  }
}
class update_Delete {
  bit(1) has_attributeName;
  if (has_attributeName) {
    attr_AttributeName attributeName;
  }
  bit(1) has_index;
  if (has_index) {
    attr_index index;
  }
  attr_custom_IDREF ref;
  bit(1) has_attr_any;
  if (has_attr_any) {
    attr_any any;
  }
}
class update_Insert {
  bit(1) has_attributeName;
  if (has_attributeName) {
    attr_AttributeName attributeName;
  }
  bit(1) has_index;
  if (has_index) {
    attr_index index;
  }
  attr_custom_IDREF ref;
  bit(1) has_value;
  if (has_value) {
    attr_custom_updateValue value;
  }
  bit(1) has_attr_any;
  if (has_attr_any) {
    attr_any any;
  }
  bit(1) opt_group;
  if (opt_group) {
    updatable_elements child0;
  }
}
class updatable_elements {
  bit(1) ch4;
  switch(ch4){
    case 0:
      bit(6) ch6;
      switch(ch6){
        case 0:
          element_a a;
          break;
        case 1:
          element_animate animate;
          break;
        case 2:
          element_animate animateColor;
          break;
        case 3:
          element_animateMotion animateMotion;
          break;
        case 4:
          element_animateTransform animateTransform;
          break;
        case 5:
          element_audio audio;
          break;
        case 6:
          element_circle circle;
          break;
        case 7:
          element_defs defs;
          break;
        case 8:
          element_desc_metaData_title desc;
          break;
        case 9:
          element_ellipse ellipse;
          break;
        case 10:
          element_foreignObject foreignObject;
          break;
        case 11:
          element_g g;
          break;
        case 12:
          element_image image;
          break;
        case 13:
          element_line line;
          break;
        case 14:
          element_linearGradient linearGradient;
          break;
        case 15:
          element_desc_metaData_title metadata;
          break;
        case 16:
          element_mpath mpath;
          break;
        case 17:
          element_path path;
          break;
        case 18:
          element_polygon polygon;
          break;
        case 19:
          element_polygon polyline;
          break;
        case 20:
          element_radialGradient radialGradient;
          break;
        case 21:
          element_rect rect;
          break;
        case 22:
          element_script script;
          break;
        case 23:
          element_set set;
          break;
        case 24:
          element_stop stop;
          break;
        case 25:
          element_svg svg;
          break;
        case 26:
          element_switch switch;
          break;
        case 27:
          element_text text;
          break;
        case 28:
          element_desc_metaData_title title;
          break;
        case 29:
          element_tspan tspan;
          break;
        case 30:
          element_use use;
          break;
        case 31:
          element_video video;
          break;
        case 32:
          element_listener listener;
          break;
        }
      break;
    case 1:
      bit(3) ch61;
      switch(ch61){
        case 0:
          element_conditional conditional;
          break;
        case 1:
          element_cursorManager cursorManager;
          break;
        case 2:
          element_any extElement;
          break;
        case 3:
          privateElementContainer privateElement;
          break;
        case 4:
          element_rectClip rectClip;
          break;
        case 5:
          element_selector selector;
          break;
        case 6:
          element_simpleLayout simpleLayout;
          break;
        }
      break;
    }
}
class element_svg {
  bit(1) has_id;
  if (has_id) {
    attr_custom_ID id;
  }
  bit(1) has_rare;
  if (has_rare) {
    attr_custom_rare rare;
  }
  bit(1) has_fill;
  if (has_fill) {
    attr_custom_paint fill;
  }
  bit(1) has_stroke;
  if (has_stroke) {
    attr_custom_paint stroke;
  }
  bit(1) has_baseProfile;
  if (has_baseProfile) {
    attr_custom_byteAlignedString baseProfile;
  }
  bit(1) has_contentScriptType;
  if (has_contentScriptType) {
    attr_custom_byteAlignedString contentScriptType;
  }
  bit(1) externalResourcesRequired;
  attr_custom_valueWithUnits height;
  bit(1) has_playbackOrder;
  if (has_playbackOrder) {
    attr_playbackOrder playbackOrder;
  }
  bit(1) has_preserveAspectRatio;
  if (has_preserveAspectRatio) {
    attr_preserveAspectRatio preserveAspectRatio;
  }
  bit(1) has_snapshotTime;
  if (has_snapshotTime) {
    attr_time snapshotTime;
  }
  bit(1) has_syncBehaviorDefault;
  if (has_syncBehaviorDefault) {
    attr_syncBehaviorDefault syncBehaviorDefault;
  }
  bit(1) has_syncToleranceDefault;
  if (has_syncToleranceDefault) {
    attr_syncToleranceDefault syncToleranceDefault;
  }
  bit(1) has_timelineBegin;
  if (has_timelineBegin) {
    attr_timeLineBegin timelineBegin;
  }
  bit(1) has_version;
  if (has_version) {
    attr_custom_byteAlignedString version;
  }
  bit(1) has_viewBox;
  if (has_viewBox) {
    attr_viewBox viewBox;
  }
  attr_custom_valueWithUnits width;
  bit(1) has_zoomAndPan;
  if (has_zoomAndPan) {
    attr_zoomAndPan zoomAndPan;
  }
  bit(1) has_attr_any;
  if (has_attr_any) {
    attr_any any;
  }
  object_content child0;
}
class element_cursorManager {
  bit(1) has_id;
  if (has_id) {
    attr_custom_ID id;
  }
  bit(1) has_rare;
  if (has_rare) {
    attr_custom_rare rare;
  }
  bit(1) has_x;
  if (has_x) {
    attr_custom_coordinate x;
  }
  bit(1) has_y;
  if (has_y) {
    attr_custom_coordinate y;
  }
  bit(1) has_href;
  if (has_href) {
    attr_custom_anyURI href;
  }
  bit(1) has_attr_any;
  if (has_attr_any) {
    attr_any any;
  }
  object_content child0;
}
class privateElementContainer {
  bit(4) codePoint;
  switch(codePoint){
    case 0:
      privateAnyXMLElement anyXML;
      break;
    case 1:
      privateOpaqueElement opaque;
      break;
    case 2:
      element_any reserved;
      break;
    default:
      attr_custom_extension ext;
      break;
  }
}
class element_rectClip {
  bit(1) has_id;
  if (has_id) {
    attr_custom_ID id;
  }
  bit(1) has_rare;
  if (has_rare) {
    attr_custom_rare rare;
  }
  bit(1) has_fill;
  if (has_fill) {
    attr_custom_paint fill;
  }
  bit(1) has_stroke;
  if (has_stroke) {
    attr_custom_paint stroke;
  }
  bit(1) externalResourcesRequired;
  bit(1) has_size;
  if (has_size) {
    attr_point size;
  }
  bit(1) has_attr_any;
  if (has_attr_any) {
    attr_any any;
  }
  object_content child0;
}
class element_selector {
  bit(1) has_id;
  if (has_id) {
    attr_custom_ID id;
  }
  bit(1) has_rare;
  if (has_rare) {
    attr_custom_rare rare;
  }
  bit(1) has_fill;
  if (has_fill) {
    attr_custom_paint fill;
  }
  bit(1) has_stroke;
  if (has_stroke) {
    attr_custom_paint stroke;
  }
  bit(1) externalResourcesRequired;
  bit(1) has_choice;
  if (has_choice) {
    attr_choice choice;
  }
  bit(1) has_attr_any;
  if (has_attr_any) {
    attr_any any;
  }
  object_content child0;
}
class element_simpleLayout {
  bit(1) has_id;
  if (has_id) {
    attr_custom_ID id;
  }
  bit(1) has_rare;
  if (has_rare) {
    attr_custom_rare rare;
  }
  bit(1) has_fill;
  if (has_fill) {
    attr_custom_paint fill;
  }
  bit(1) has_stroke;
  if (has_stroke) {
    attr_custom_paint stroke;
  }
  bit(1) has_delta;
  if (has_delta) {
    attr_point delta;
  }
  bit(1) externalResourcesRequired;
  bit(1) has_attr_any;
  if (has_attr_any) {
    attr_any any;
  }
  object_content child0;
}
class update_NewScene {
  bit(1) has_attr_any;
  if (has_attr_any) {
    attr_any any;
  }
  element_svg child;
}
class update_RefreshScene {
  vluimsbf5 time;
  bit(1) has_attr_any;
  if (has_attr_any) {
    attr_any any;
  }
  element_svg child;
}
class update_Replace {
  bit(1) has_attributeName;
  if (has_attributeName) {
    attr_AttributeName attributeName;
  }
  bit(1) has_index;
  if (has_index) {
    attr_index index;
  }
  bit(1) has_operandAttribute;
  if (has_operandAttribute) {
    attr_AttributeName operandAttribute;
  }
  bit(1) has_operandElementId;
  if (has_operandElementId) {
    attr_custom_IDREF operandElementId;
  }
  attr_custom_IDREF ref;
  bit(1) has_value;
  if (has_value) {
    attr_custom_updateValue value;
  }
  bit(1) has_attr_any;
  if (has_attr_any) {
    attr_any any;
  }
  bit(1) opt_group;
  if (opt_group) {
    vluimsbf5 occ1;
    for(int t=0;t<occ1;t++) {
      updatable_elements child0[[t]];
    }
  }
}
class update_Restore {
  attr_custom_byteAlignedString groupID;
  bit(1) has_attr_any;
  if (has_attr_any) {
    attr_any any;
  }
}
class update_Save {
  attr_custom_ElementAttributeList elementAttributeList;
  attr_custom_byteAlignedString groupID;
  bit(1) has_attr_any;
  if (has_attr_any) {
    attr_any any;
  }
}
class update_SendEvent {
  attr_custom_event event;
  bit(1) has_intvalue;
  if (has_intvalue) {
    signedInt intvalue;
  }
  bit(1) has_pointvalue;
  if (has_pointvalue) {
    attr_point pointvalue;
  }
  attr_custom_IDREF ref;
  bit(1) has_stringvalue;
  if (has_stringvalue) {
    attr_custom_byteAlignedString stringvalue;
  }
  bit(1) has_attr_any;
  if (has_attr_any) {
    attr_any any;
  }
}
// AMD1 elements
// to be enclosed in an element_any with extensionID = 2

class SVGAmd1Extension {
  vluimsbf5 occ0;
  for(int t=0;t<occ0+1;t++) {
    bit(4) ch5;
    switch(ch5){
    case 0:
      element_animation animation;
      break;
    case 1:
      element_discard discard;
      break;
    case 2:
      element_font font;
      break;
    case 3:
        element_fontFace font_face;
      break;
    case 4:
        element_fontFaceSrc font_face_src;
      break;
    case 5:
        element_fontFaceUri font_face_uri;
      break;
    case 6:
      element_glyph glyph;
      break;
    case 7:
      element_handler handler;
      break;
    case 8:
        element_hkern element_hkern;
      break;
    case 9:
        element_missingGlyph missing_glyph;
      break;
    case 10:
        element_prefetch element_prefetch;
      break;
    case 11:
      element_solidColor solidColor;
      break;
    case 12:
      element_tBreak tBreak;
      break;
    case 13:
      element_textArea textArea;
      break;
    default:
      break;
    }
  }
}
class element_animation {
  bit(1) has_id;
  if (has_id) {
    attr_custom_ID id;
  }
  bit(1) has_rare;
  if (has_rare) {
    attr_custom_rare rare;
  }
  bit(1) has_begin;
  if (has_begin) {
    attr_smil_times begin;
  }
  bit(1) has_dur;
  if (has_dur) {
    attr_time dur;
  }
  bit(1) externalResourcesRequired;
  bit(1) has_fill;
  if (has_fill) {
    attr_animFill fill;
  }
  bit(1) has_height;
  if (has_height) {
    attr_custom_coordinate height;
  }
  bit(1) has_preserveAspectRatio;
  if (has_preserveAspectRatio) {
    attr_preserveAspectRatio preserveAspectRatio;
  }
  bit(1) has_repeatCount;
  if (has_repeatCount) {
    attr_repeatCount repeatCount;
  }
  bit(1) has_repeatDur;
  if (has_repeatDur) {
    attr_repeatDur repeatDur;
  }
  bit(1) has_restart;
  if (has_restart) {
    attr_restart restart;
  }
  bit(1) has_syncBehavior;
  if (has_syncBehavior) {
    attr_syncBehavior syncBehavior;
  }
  bit(1) has_syncTolerance;
  if (has_syncTolerance) {
    attr_syncTolerance syncTolerance;
  }
  bit(1) has_type;
  if (has_type) {
    attr_custom_byteAlignedString type;
  }
  bit(1) has_width;
  if (has_width) {
    attr_custom_coordinate width;
  }
  bit(1) has_x;
  if (has_x) {
    attr_custom_coordinate x;
  }
  bit(1) has_y;
  if (has_y) {
    attr_custom_coordinate y;
  }
  bit(1) has_href;
  if (has_href) {
    attr_custom_anyURI href;
  }
  bit(1) has_clipBegin;
  if (has_clipBegin) {
    attr_time clipBegin;
  }
  bit(1) has_clipEnd;
  if (has_clipEnd) {
    attr_time clipEnd;
  }
  bit(1) has_syncReference;
  if (has_syncReference) {
    attr_custom_anyURI syncReference;
  }
  bit(1) has_attr_any;
  if (has_attr_any) {
    attr_any any;
  }
  object_content child0;
}
class element_discard {
  bit(1) has_id;
  if (has_id) {
    attr_custom_ID id;
  }
  bit(1) has_rare;
  if (has_rare) {
    attr_custom_rare rare;
  }
  bit(1) has_begin;
  if (has_begin) {
    attr_smil_times begin;
  }
  bit(1) has_href;
  if (has_href) {
    attr_custom_anyURI href;
  }
  bit(1) has_attr_any;
  if (has_attr_any) {
    attr_any any;
  }
  object_content child0;
}
class element_font {
  bit(1) has_id;
  if (has_id) {
    attr_custom_ID id;
  }
  bit(1) has_rare;
  if (has_rare) {
    attr_custom_rare rare;
  }
  bit(1) externalResourcesRequired;
  bit(1) has_horiz_adv_x;
  if(has_horiz_adv_x) {
    attr_custom_fixed_16_8 horiz_adv_x;
  }
  bit(1) has_horiz_origin_x;
  if(has_horiz_origin_x) {
    attr_custom_fixed_16_8 horiz_origin_x;
  }
  bit(1) has_attr_any;
  if (has_attr_any) {
    attr_any any;
  }
  object_content child0;
}
class element_fontFace {
  bit(1) has_id;
  if (has_id) {
    attr_custom_ID id;
  }
  bit(1) has_rare;
  if (has_rare) {
    attr_custom_rare rare;
  }
  bit(1) has_accent_height;
  if(has_accent_height) {
    attr_custom_fixed_16_8 accent_height;
  }
  bit(1) has_alphabetic;
  if (has_alphabetic) {
    attr_custom_fixed_16_8 alphabetic;
  }
  bit(1) has_ascent;
  if (has_ascent) {
    attr_custom_fixed_16_8 ascent;
  }
  bit(1) has_bbox;
  if (has_bbox) {
    attr_custom_byteAlignedString bbox;
  }
  bit(1) has_cap_height;
  if(has_cap_height) {
    attr_custom_fixed_16_8 cap_height;
  }
  bit(1) has_descent;
  if (has_descent) {
    attr_custom_fixed_16_8 descent;
  }
  bit(1) externalResourcesRequired;
  bit(1) has_font_family;
  if(has_font_family) {
    attr_custom_byteAlignedString font_family;
  }
  bit(1) has_font_stretch;
  if(has_font_stretch) {
    attr_custom_byteAlignedString font_stretch;
  }
  bit(1) has_font_style;
  if(has_font_style) {
    attr_custom_byteAlignedString font_style;
  }
  bit(1) has_font_variant;
  if(has_font_variant) {
    attr_custom_byteAlignedString font_variant;
  }
  bit(1) has_font_weight;
  if(has_font_weight) {
    attr_custom_byteAlignedString font_weight;
  }
  bit(1) has_hanging;
  if (has_hanging) {
    attr_custom_fixed_16_8 hanging;
  }
  bit(1) has_ideographic;
  if (has_ideographic) {
    attr_custom_fixed_16_8 ideographic;
  }
  bit(1) has_mathematical;
  if (has_mathematical) {
    attr_custom_fixed_16_8 mathematical;
  }
  bit(1) has_overline_position;
  if(has_overline_position) {
    attr_custom_fixed_16_8 overline_position;
  }
  bit(1) has_overline_thickness;
  if(has_overline_thickness) {
    attr_custom_fixed_16_8 overline_thickness;
  }
  bit(1) has_panose_1;
  if(has_panose_1) {
    attr_custom_byteAlignedString panose_1;
  }
  bit(1) has_slope;
  if (has_slope) {
    attr_custom_fixed_16_8 slope;
  }
  bit(1) has_stemh;
  if (has_stemh) {
    attr_custom_fixed_16_8 stemh;
  }
  bit(1) has_stemv;
  if (has_stemv) {
    attr_custom_fixed_16_8 stemv;
  }
  bit(1) has_strikethrough_position;
  if(has_strikethrough_position) {
    attr_custom_fixed_16_8 strikethrough_position;
  }
  bit(1) has_strikethrough_thickness;
  if(has_strikethrough_thickness) {
    attr_custom_fixed_16_8 strikethrough_thickness;
  }
  bit(1) has_underline_position;
  if(has_underline_position) {
    attr_custom_fixed_16_8 underline_position;
  }
  bit(1) has_underline_thickness;
  if(has_underline_thickness) {
    attr_custom_fixed_16_8 underline_thickness;
  }
  bit(1) has_unicode_range;
  if(has_unicode_range) {
    attr_custom_byteAlignedString unicode_range;
  }
  bit(1) has_units_per_em;
  if(has_units_per_em) {
    attr_custom_fixed_16_8 units_per_em;
  }
  bit(1) has_widths;
  if (has_widths) {
    attr_custom_byteAlignedString widths;
  }
  bit(1) has_x_height;
  if(has_x_height) {
    attr_custom_coordinate x_height;
  }
  bit(1) has_attr_any;
  if (has_attr_any) {
    attr_any any;
  }
  object_content child0;
}
class element_fontFaceSrc {
  bit(1) has_id;
  if (has_id) {
    attr_custom_ID id;
  }
  bit(1) has_rare;
  if (has_rare) {
    attr_custom_rare rare;
  }
  bit(1) has_attr_any;
  if (has_attr_any) {
    attr_any any;
  }
  object_content child1;
}
class element_fontFaceUri {
  bit(1) has_id;
  if (has_id) {
    attr_custom_ID id;
  }
  bit(1) has_rare;
  if (has_rare) {
    attr_custom_rare rare;
  }
  bit(1) externalResourcesRequired;
  bit(1) has_href;
  if (has_href) {
    attr_custom_anyURI href;
  }
  bit(1) has_attr_any;
  if (has_attr_any) {
    attr_any any;
  }
  object_content child0;
}
class element_glyph {
  bit(1) has_id;
  if (has_id) {
    attr_custom_ID id;
  }
  bit(1) has_rare;
  if (has_rare) {
    attr_custom_rare rare;
  }
  bit(1) has_arabic_form;
  if(has_arabic_form) {
    attr_custom_byteAlignedString arabic_form;
  }
  bit(1) has_d;
  if (has_d) {
    attr_custom_path d;
  }
  bit(1) externalResourcesRequired;
  bit(1) has_glyph_name;
  if(has_glyph_name) {
    attr_custom_byteAlignedString glyph_name;
  }
  bit(1) has_horiz_adv_x;
  if(has_horiz_adv_x) {
    attr_custom_fixed_16_8 horiz_adv_x;
  }
  bit(1) has_lang;
  if (has_lang) {
    attr_custom_byteAlignedString lang;
  }
  bit(1) has_unicode;
  if (has_unicode) {
    attr_custom_byteAlignedString unicode;
  }
  bit(1) has_attr_any;
  if (has_attr_any) {
    attr_any any;
  }
  object_content child0;
}
class element_handler {
  bit(1) has_id;
  if (has_id) {
    attr_custom_ID id;
  }
  bit(1) has_rare;
  if (has_rare) {
    attr_custom_rare rare;
  }
  bit(1) externalResourcesRequired;
  bit(1) has_type;
  if (has_type) {
    attr_script type;
  }
  bit(1) has_event;
  if (has_event) {
    attr_custom_event event;
  }
  bit(1) has_attr_any;
  if (has_attr_any) {
    attr_any any;
  }
  object_content child0;
}
class element_hkern {
  bit(1) has_id;
  if (has_id) {
    attr_custom_ID id;
  }
  bit(1) has_rare;
  if (has_rare) {
    attr_custom_rare rare;
  }
  bit(1) has_g1;
  if (has_g1) {
    attr_custom_byteAlignedString g1;
  }
  bit(1) has_g2;
  if (has_g2) {
    attr_custom_byteAlignedString g2;
  }
  bit(1) has_k;
  if (has_k) {
    attr_custom_fixed_16_8 k;
  }
  bit(1) has_u1;
  if (has_u1) {
    attr_custom_byteAlignedString u1;
  }
  bit(1) has_u2;
  if (has_u2) {
    attr_custom_byteAlignedString u2;
  }
  bit(1) has_attr_any;
  if (has_attr_any) {
    attr_any any;
  }
  object_content child0;
}
class element_missingGlyph {
  bit(1) has_id;
  if (has_id) {
    attr_custom_ID id;
  }
  bit(1) has_rare;
  if (has_rare) {
    attr_custom_rare rare;
  }
  bit(1) has_d;
  if (has_d) {
    attr_custom_path d;
  }
  bit(1) has_horiz_adv_x;
  if(has_horiz_adv_x) {
    attr_custom_fixed_16_8 horiz_adv_x;
  }
  bit(1) has_attr_any;
  if (has_attr_any) {
    attr_any any;
  }
  object_content child0;
}
class element_prefetch {
  bit(1) has_id;
  if (has_id) {
    attr_custom_ID id;
  }
  bit(1) has_rare;
  if (has_rare) {
    attr_custom_rare rare;
  }
  bit(1) has_bandwidth;
  if (has_bandwidth) {
    vluimsbf5 bandwidth;
  }
  bit(1) has_mediaCharacterEncoding;
  if (has_mediaCharacterEncoding) {
    attr_custom_byteAlignedString mediaCharacterEncoding;
  }
  bit(1) has_mediaContentEncodings;
  if (has_mediaContentEncodings) {
    attr_custom_byteAlignedString mediaContentEncodings;
  }
  bit(1) has_mediaSize;
  if (has_mediaSize) {
    vluimsbf5 mediaSize;
  }
  bit(1) has_mediaTime;
  if (has_mediaTime) {
    vluimsbf5 mediaTime;
  }
  bit(1) has_href;
  if (has_href) {
    attr_custom_anyURI href;
  }
  bit(1) has_attr_any;
  if (has_attr_any) {
    attr_any any;
  }
  object_content child0;
}
class element_solidColor {
  bit(1) has_id;
  if (has_id) {
    attr_custom_ID id;
  }
  bit(1) has_rare;
  if (has_rare) {
    attr_custom_rare rare;
  }
  bit(1) has_fill;
  if(has_fill) {
    attr_custom_paint fill;
  }
  bit(1) has_stroke;
  if(has_stroke) {
    attr_custom_paint stroke;
  }
  bit(1) has_attr_any;
  if (has_attr_any) {
    attr_any any;
  }
  object_content child0;
}
class element_tBreak {
  bit(1) has_id;
  if (has_id) {
    attr_custom_ID id;
  }
  bit(1) has_rare;
  if (has_rare) {
    attr_custom_rare rare;
  }
  bit(1) has_attr_any;
  if (has_attr_any) {
    attr_any any;
  }
  object_content child1;
}
class element_textArea {
  bit(1) has_id;
  if (has_id) {
    attr_custom_ID id;
  }
  bit(1) has_rare;
  if (has_rare) {
    attr_custom_rare rare;
  }
  bit(1) has_fill;
  if (has_fill) {
    attr_custom_paint fill;
  }
  bit(1) has_stroke;
  if (has_stroke) {
    attr_custom_paint stroke;
  }
  bit(1) has_editable;
  if(has_editable) {
    attr_editable editable;
  }
  bit(1) has_height;
  if (has_height) {
    attr_custom_coordinate height;
  }
  bit(1) has_width;
  if (has_width) {
    attr_custom_coordinate width;
  }
  bit(1) has_x;
  if (has_x) {
    attr_custom_coordinate x;
  }
  bit(1) has_y;
  if (has_y) {
    attr_custom_coordinate y;
  }
  bit(1) has_attr_any;
  if (has_attr_any) {
    attr_any any;
  }
  object_content child0;
}
class update_Activate {
  attr_custom_IDREF ref;
  bit(1) has_attr_any;
  if (has_attr_any) {
    attr_any any;
  }
}
class update_Deactivate {
  attr_custom_IDREF ref;
  bit(1) has_attr_any;
  if (has_attr_any) {
    attr_any any;
  }
}
class update_ReleaseResource {
  attr_custom_anyURI ref;
  bit(1) has_attr_any;
  if (has_attr_any) {
    attr_any any;
  }
}
class LASeRAmd1Extension {
  vluimsbf5 occ1;
  for(int t=0;t<occ1+1;t++) {
    bit(2) ch5;
    switch(ch5){
      case 0:
        element_animateScroll animateScroll;
        break;
      case 1:
        element_setScroll setScroll;
        break;
      case 2:
        element_streamSource streamSource;
        break;
      case 3:
        element_updates updates;
        break;
      }
  }
}
class element_animateScroll {
  bit(1) has_id;
  if (has_id) {
    attr_custom_ID id;
  }
  bit(1) has_rare;
  if (has_rare) {
    attr_custom_rare rare;
  }
  bit(1) has_begin;
  if (has_begin) {
    attr_smil_times begin;
  }
  bit(1) has_by;
  if (has_by) {
    attr_scrollStop by;
  }
  bit(1) has_delayAtEnd;
  if (has_delayAtEnd) {
    attr_time delayAtEnd;
  }
  bit(1) has_delayAtStart;
  if (has_delayAtStart) {
    attr_time delayAtStart;
  }
  bit(1) has_direction;
  if (has_direction) {
    attr_direction direction;
  }
  bit(1) has_dur;
  if (has_dur) {
    attr_time dur;
  }
  bit(1) has_fill;
  if (has_fill) {
    attr_animFill fill;
  }
  bit(1) has_from;
  if (has_from) {
    attr_scrollStop from;
  }
  bit(1) has_repeatCount;
  if (has_repeatCount) {
    attr_repeatCount repeatCount;
  }
  bit(1) has_repeatDur;
  if (has_repeatDur) {
    attr_repeatDur repeatDur;
  }
  bit(1) has_restart;
  if (has_restart) {
    attr_restart restart;
  }
  bit(1) has_speed;
  if (has_speed) {
    attr_time speed;
  }
  bit(1) has_to;
  if (has_to) {
    attr_scrollStop to;
  }
  bit(1) has_href;
  if (has_href) {
    attr_custom_anyURI href;
  }
  bit(1) has_attr_any;
  if (has_attr_any) {
    attr_any any;
  }
  object_content child0;
}
class element_setScroll {
  bit(1) has_id;
  if (has_id) {
    attr_custom_ID id;
  }
  bit(1) has_rare;
  if (has_rare) {
    attr_custom_rare rare;
  }
  bit(1) has_begin;
  if (has_begin) {
    attr_smil_times begin;
  }
  bit(1) has_direction;
  if (has_direction) {
    attr_direction direction;
  }
  bit(1) has_increment;
  if (has_increment) {
    attr_scrollStop increment;
  bit(1) has_to;
  if (has_to) {
    attr_scrollStop to;
  }
  bit(1) has_href;
  if (has_href) {
    attr_custom_anyURI href;
  }
  bit(1) has_attr_any;
  if (has_attr_any) {
    attr_any any;
  }
  object_content child0;
}
class element_streamSource {
  bit(1) has_id;
  if (has_id) {
    attr_custom_ID id;
  }
  bit(1) has_rare;
  if (has_rare) {
    attr_custom_rare rare;
  }
  bit(1) has_height;
  if (has_height) {
    attr_custom_coordinate height;
  }
  bit(1) has_mode;
  if (has_mode) {
    attr_streamSourceMode mode;
  }
  bit(1) has_sourceIndex;
  if (has_sourceIndex) {
    vluimsbf5 sourceIndex;
  }
  attr_sources sources;
  bit(1) has_width;
  if (has_width) {
    attr_custom_coordinate width;
  }
  bit(1) has_attr_any;
  if (has_attr_any) {
    attr_any any;
  }
  object_content child0;
}
class element_updates {
  bit(1) has_id;
  if (has_id) {
    attr_custom_ID id;
  }
  bit(1) has_rare;
  if (has_rare) {
    attr_custom_rare rare;
  }
  bit(1) has_begin;
  if (has_begin) {
    attr_smil_times begin;
  }
  bit(1) has_dur;
  if (has_dur) {
    attr_time dur;
  }
  bit(1) has_repeatCount;
  if (has_repeatCount) {
    attr_repeatCount repeatCount;
  }
  bit(1) has_repeatDur;
  if (has_repeatDur) {
    attr_repeatDur repeatDur;
  }
  bit(1) has_restart;
  if (has_restart) {
    attr_restart restart;
  }
  bit(1) has_syncBehavior;
  if (has_syncBehavior) {
    attr_syncBehavior syncBehavior;
  }
  bit(1) has_syncTolerance;
  if (has_syncTolerance) {
    attr_syncTolerance syncTolerance;
  }
  bit(1) has_href;
  if (has_href) {
    attr_custom_anyURI href;
  }
  bit(1) has_clipBegin;
  if (has_clipBegin) {
    attr_time clipBegin;
  }
  bit(1) has_clipEnd;
  if (has_clipEnd) {
    attr_time clipEnd;
  }
  bit(1) has_flow;
  if(has_flow) {
    // Enumeration: any{0} complete{1} segment{2}
    bit(2) flow;
  }
  bit(1) has_syncReference;
  if (has_syncReference) {
    attr_custom_anyURI syncReference;
  }
  bit(1) has_security;
  if(has_security) {
    // Enumeration: new{0} parent{1}
    bit(2)security;
  }
  bit(1) has_attr_any;
  if (has_attr_any) {
    attr_any any;
  }
  object_content child0;
}
class LASeRAmd1Command { 
  vluimsbf5 occ3;
  for(int t=0;t<occ3+1;t++) {
    bit(2) ch5;
    switch(ch5){
    case 0:
        privateElementContainer privateElementContainer; // to allow anyXML at the updates level (top level of the AU)
      break;
    case 1:
        update_Activate Activate;
      break;
    case 2:
        update_Deactivate Deactivate;
      break;
    case 3:
        update_ReleaseResource ReleaseResource;
        break;
    }
  }
}
//***********************************************************************************************
// start specific classes
//***********************************************************************************************

class LASeRUnit {
  LASeRUnitHeader h;
  initialisations c;
  vluimsbf5 occ1;
  for(int t=0;t<occ1+1;t++) {
    updates child0;
  }
  bit(1) opt_group;
  if (opt_group) {
    attr_custom_extension ext;
  }
}
class LASeRUnitHeader {
  bit(1) resetEncodingContext;
  bit(1) opt_group;
  if (opt_group) {
    attr_custom_extension ext;
  }
}
class initialisations {
  colorInitialisation c;
  fontInitialisation f;
  privateDataIdentifierInitialisation p;
  anyXMLInitialisation a;
  extendedInitialisation e;
}


//***********************************************************************************************
// extensions
//***********************************************************************************************

//for elements 
class element_any {
  uint(extensionIDBits) extensionID;
  vluimsbf5 len; //length in bits
  if (extensionID == 2) { //LASeR AMD1
    const vluimsbf5 reserved = 87; // or "const bit(10) reserved = 599;"
    vluimsbf5 occ2;
    for(int t=0;t<occ2+1;t++) {
      bit(2) ch5;
      switch(ch5){
        case 0:
          SVGAmd1Extension SVGAmd1Extension;
          break;
        case 2:
          LASeRAmd1Extension LASeRAmd1Extension;
          break;
      }
    }
  } else { 
    bit[len] toSkip;
  }
} 


class update_any {
  uint(extensionIDBits) extensionID;
  vluimsbf5 len; //length in bits
  if (extensionID == 2) { //LASeR AMD1 
    const vluimsbf5 reserved = 87; // or "const bit(10) reserved = 599;"
    vluimsbf5 occ2;
    for(int t=0;t<occ2+1;t++) {
      const bit(2) reserved = 1;
      LASeRAmd1Command LASeRAmd1Command; 
    }
  } else { 
    bit[len] toSkip;
  }
} 

//for attributes
class attr_any {
  do {
    uint(extensionIDBits) extensionID;
    vluimsbf5 len; //length in bits
    if (extensionID == 2) { //LASeR AMD1
      bit(1) hasRequiredFonts;
      if (hasRequiredFonts) {
      attr_custom_byteAlignedString requiredFonts;
      }
      bit(1) hasX;
      if (hasX) { 
        attr_custom_coordinate x;
      }
      bit(1) hasY;
      if (hasY) { 
        attr_custom_coordinate y;
      }
    } else {
      bit[len] toSkip;
      bit(1) hasNextExtension;
    }
  } while (hasNextExtension);
}


//***********************************************************************************************
// LASeRHeader
//***********************************************************************************************

class LASeRHeader {
  uint(8) profile;
  uint(8) level;
  bit(3) reserved;
  bit(2) pointsCodec;
  bit(4) pathComponents;
  bit(1) useFullRequestHost;
  bit(1) hasTimeResolution;
  if (hasTimeResolution) {
    uint(16) timeResolution;
  }
  bit(4) colorComponentBits_minus_1;
  colorComponentBits = colorComponentBits_minus_1 + 1;
  bit(4) resolution;
  bit(5) coordBits;
  bit(4) scaleBits_minus_coordBits;
  bit(1) newSceneIndicator;
  bit(3) reserved;
  // extensionIDBits defines the number of bits of extension tags
  bit(4) extensionIDBits;
  bit(1) hasExtConfiguration;
  if (hasExtConfiguration) {
    vluimsbf5 len;
    byte[len] extConfiguration; //extConfiguration is defined in Table 10
  }
  bit(1) hasExtension;
  if (hasExtension) {
    attr_custom_extension ext;
  }
}

//***********************************************************************************************
// Initialisation codecs
//***********************************************************************************************

int colorIndex = -1;

class colorInitialisation {
  bit(1) hasColors;
  if (hasColors) {
    // a color table in front of each AU
    vluimsbf5 nbColors;
    for (int i = 0; i < nbColors; i++) {
      colorIndex = colorIndex + 1;
      uint(colorComponentBits) red[[colorIndex]];
      uint(colorComponentBits) green[[colorIndex]];
      uint(colorComponentBits) blue[[colorIndex]];
    }
    colorIndexBits = log2sup(colorIndex);
  }
}

int fontIndex = -1;

class fontInitialisation {
  bit(1) hasFonts;
  if (hasFonts) {
    // a font table in front of each AU
    vluimsbf5 nbFonts;
    for (int i = 0; i < nbFonts; i++) {
      fontIndex = fontIndex + 1;
      attr_custom_byteAlignedString font[[fontIndex]];
    }
    fontIndexBits = log2sup(fontIndex);
  }
}

int privateDataIdentifierIndex = -1;

class privateDataIdentifierInitialisation {
  bit(1) hasPrivateDataIdentifiers;
  if (hasPrivateDataIdentifiers) {
    // a privateDataIdentifiertable in front of each AU
    vluimsbf5 nbPrivateDataIdentifiers;
    for (int i = 0; i < nbPrivateDataIdentifiers; i++) {
      privateDataIdentifierIndex = privateDataIdentifierIndex + 1;
      // the purpose of these strings is to ensure non collision between different private data
      // examples are URNs, uuids, ...
      attr_custom_byteAlignedString privateDataIdentifier[[privateDataIdentifierIndex]];
    }
    privateDataIdentifierIndexBits = log2sup(privateDataIdentifierIndex);
  }
}

int tagIndex = -1;

class anyXMLInitialisation {
  bit(1) hasTags;
  if (hasTags) {
    // a tag table in front of each AU
    vluimsbf5 nbTags;
    for (int i = 0; i < nbTags; i++) {
      if (i == 0) {
        // tag 0 for use for priv. attrs on LASeR elements
        bit(1) hasAttrs;
        if (hasAttrs) {
          // the first bin is reserved for private attributes of LASeR elements
          // and to attributes with a privateDataIdentifier different from their parent element
          vluimsbf5 nbAttrNames[[0]];
          for (int t = 0; t < nbAttrNames[[0]]; t++) {
            uint(privateDataIdentifierIndexBits) privateDataIdentifierIndex[[0]][[t]];
            attr_custom_byteAlignedString attrName[[0]][[t]];
          }
        }
      } else {
        tagIndex = tagIndex + 1;
        uint(privateDataIdentifierIndexBits) privateDataIdentifierIndex[[i]];
        attr_custom_byteAlignedString tag[[i]];
        bit(1) hasAttrs;
        if (hasAttrs) {
          // each private element tag has a bin for private attributes
          vluimsbf5 nbAttrNames[[tagIndex]];
          for (int t = 0; t < nbAttrNames[[tagIndex]]; t++) {
            attr_custom_byteAlignedString attrName[[tagIndex]][[t]];
          }
        }
      }
    }
    tagIndexBits = log2sup(tagIndex);
  }
}

class extendedInitialisation {
  // stringIDTable: external string ID references
  vluimsbf5 countG;
  for (int i = 0; i < countG; i++) {
    vluimsbf5 binaryIdForThisStringID[[i]];
    attr_custom_byteAlignedString stringID[[i]];
  }
  bit(1) hasExtension;
  if (hasExtension) {
    vluimsbf5 len;
    // globalStreamTable: external global streamID references
    vluimsbf5 countGS;
    for (int i = 0; i < count; i++) {
      vluimsbf5 localStreamIdForThisGlobal[[i]];
      byteAlignedStringClass globalName[[i]];
    }
    bit[len2] remainingData;
    // len2 is defined implicitly as: len - sizeof(globalStreamTable)  
  }
}
class object_content {
  bit(1) opt_group;
  if (opt_group) {
    privateAttributeContainer privateAttributes;
  }
  bit(1) opt_group1;
  if (opt_group1) {
    vluimsbf5 occ1;
    for(int t=0;t<occ1;t++) {
      elements child0[[t]];
    }
  }
}
class attr_AttributeName {
    bit(1) choice;
    switch(choice) {
      case 0:
      // Enumeration: a.target{0} accumulate{1} additive{2} audio-level{3} bandwidth{4} begin{5} calcMode{6} children{7} choice{8} clipBegin{9} clipEnd{10} color{11} color-rendering{12} cx{13} cy{14} d{15} delta{16} display{17} display-align{18} dur{19} editable{20} enabled{21} end{22} event{23} externalResourcesRequired{24} fill{25} fill-opacity{26} fill-rule{27} focusable{28} font-family{29} font-size{30} font-style{31} font-variant{32} font-weight{33} fullscreen{34} gradientUnits{35} handler{36} height{37} image-rendering{38} keyPoints{39} keySplines{40} keyTimes{41} line-increment{42} listener.target{43} mediaCharacterEncoding{44} mediaContentEncodings{45} mediaSize{46} mediaTime{47} nav-down{48} nav-down-left{49} nav-down-right{50} nav-left{51} nav-next{52} nav-prev{53} nav-right{54} nav-up{55} nav-up-left{56} nav-up-right{57} observer{58} offset{59} opacity{60} overflow{61} overlay{62} path{63} pathLength{64} pointer-events{65} points{66} preserveAspectRatio{67} r{68} repeatCount{69} repeatDur{70} requiredExtensions{71} requiredFeatures{72} requiredFormats{73} restart{74} rotate{75} rotation{76} rx{77} ry{78} scale{79} shape-rendering{80} size{81} solid-color{82} solid-opacity{83} stop-color{84} stop-opacity{85} stroke{86} stroke-dasharray{87} stroke-dashoffset{88} stroke-linecap{89} stroke-linejoin{90} stroke-miterlimit{91} stroke-opacity{92} stroke-width{93} svg.height{94} svg.width{95} syncBehavior{96} syncBehaviorDefault{97} syncReference{98} syncTolerance{99} syncToleranceDefault{100} systemLanguage{101} text-align{102} text-anchor{103} text-decoration{104} text-display{105} text-rendering{106} textContent{107} transform{108} transformBehavior{109} translation{110} vector-effect{111} viewBox{112} viewport-fill{113} viewport-fill-opacity{114} visibility{115} width{116} x{117} x1{118} x2{119} xlink:actuate{120} xlink:arcrole{121} xlink:href{122} xlink:role{123} xlink:show{124} xlink:title{125} xlink:type{126} xml:base{127} xml:lang{128} y{129} y1{130} y2{131} zoomAndPan{132}
          bit(8) AttributeName;
        break;
      case 1:
        int max=+2;
        for (int t=0;t<max;t++) {
          vluimsbf5 item[[t]];
        }
        break;
      }
}
class attr_accumulate {
    // Enumeration: none{0} sum{1}
    bit(1) accumulate;
}
class attr_additive {
    // Enumeration: replace{0} sum{1}
    bit(1) additive;
}
class attr_calcMode {
    // Enumeration: discrete{0} linear{1} paced{2} spline{3}
    bit(2) calcMode;
}
class attr_attributeType {
    // Enumeration: CSS{0} XML{1} auto{2}
    bit(2) attributeType;
}
class attr_smil_times {
   bit(1) choice;
   switch(choice) {
   case 0:
       vluimsbf5 max;
       for(int t=0;t<max;t++) {
      custom_smil_time item[[t]];
       }
       break;
   case 1:
       // Enumeration: indefinite {0}
       break;
   }
}
class attr_time {
    bit(1) choice;
    switch(choice) {
      case 0:
        signedInt int0;
        break;
      case 1:
        // Enumeration: auto{0} indefinite{1} media{2} none{3}                 
        bit(2) time;
        break;
      default:
        break;
   }
}
class signedInt {
  bit(1) sign; // 1 is negative
  vluimsbf5 value;
}
class attr_animFill {
    // Enumeration: freeze{0} remove{1}
    bit(1) animFill;
}
class attr_repeatCount {
    bit(1) choice;
    switch(choice) {
      case 0:
        attr_custom_fixed_16_8 fixed16_8Type0;
        break;
      case 1:
          // Enumeration: indefinite{0}
        break;
      default:
        break;
      }
}
class attr_repeatDur {
    bit(1) choice;
    switch(choice) {
      case 0:
        vluimsbf5 dur;
        break;
      case 1:
        // Enumeration: indefinite{0}
        break;
      default:
        break;
      }
}
class attr_restart {
    // Enumeration: always{0} never{1} whenNotActive{2}
    bit(2) restart;
}
class attr_floatList {
  vluimsbf5 max;
  for (int t=0;t<max;t++) {
    attr_custom_fixed_16_8 item[[t]];
  }
}
class attr_rotate {
    bit(1) choice;
    switch(choice) {
      case 0:
        attr_custom_fixed_16_8 fixed16_8Type0;
        break;
      case 1:
          // Enumeration: auto{0} auto-reverse{1}
          bit(1) rotate;
        break;
      default:
        break;
      }
}
class attr_rotscatra {
    // Enumeration: rotate{0} scale{1} skewX{2} skewY{3} translate{4}
    bit(3) rotscatra;
}
class attr_syncBehavior {
    // Enumeration: canSlip{0} default{1} independent{2} locked{3}
    bit(2) syncBehavior;
}
class attr_syncTolerance {
    bit(1) choice;
    switch(choice) {
      case 0:
        vluimsbf5 vluimsbf50;
        break;
      case 1:
          // Enumeration: default{0}
        break;
      }
}
class attr_preserveAspectRatio {
    bit(1) choice;
    switch(choice) {
      case 0:
          bit(1) choice;
          switch(choice) {
            case 0:
                // Enumeration: none{0} xMaxYMax{1} xMaxYMid{2} xMaxYMin{3} xMidYMax{4} xMidYMid{5} xMidYMin{6} xMinYMax{7} xMinYMid{8} xMinYMin{9}
                bit(4) preserveAspectRatio;
              break;
            case 1:
                // Enumeration: _reserved{0} defer xMaxYMax{1} defer xMaxYMid{2} defer xMaxYMin{3} defer xMidYMax{4} defer xMidYMid{5} defer xMidYMin{6} defer xMinYMax{7} defer xMinYMid{8} defer xMinYMin{9}
                bit(4) preserveAspectRatio;
              break;
            }
        break;
      case 1:
          // Enumeration: reserved{0}
          bit(5) preserveAspectRatio;
        break;
      }
}
class attr_transformBehavior {
    // Enumeration: geometric{0} pinned{1} pinned_180{2} pinned_270{3} pinned_90{4}
    bit(4) transformBehavior;
}
class attr_gradientUnits {
    // Enumeration: objectBoundingBox{0} userSpaceOnUse{1}
    bit(1) gradientUnits;
}
class attr_editable {
    // Enumeration: none{0} simple{1}           
    bit(1) editable;
}
class objectSame_content {
  bit(1) opt_group;
  if (opt_group) {
    vluimsbf5 occ0;
    for(int t=0;t<occ0;t++) {
      elements child0[[t]];
    }
  }
}
class attr_script {
    bit(1) choice;
    switch(choice) {
      case 0:
        attr_custom_byteAlignedString string0;
        break;
      case 1:
          // Enumeration: application/ecmascript{0} application/jar-archive{1}
          bit(1) script;
        break;
      }
}
class attr_overflow {
    // Enumeration: visible{0}
    bit(2) overflow;
}
class attr_overlay {
    bit(1) choice;
    switch(choice) {
      case 0:
        attr_custom_extension overlayExType0;
        break;
      case 1:
        // Enumeration: none{0} top{1}
        bit(1) overlay;
        break;
      default:
        break;
      }
}
class attr_defaultAction {
    // Enumeration: cancel{0} perform{1}
    bit(1) defaultAction;
}
class attr_phase {
    // Enumeration: default{0}
    bit(1) phase;
}
class attr_propagate {
    // Enumeration: continue{0} stop{1}
    bit(1) propagate;
}
class attr_index {
  vluimsbf5 value;
}
class attr_playbackOrder {
    // Enumeration: all{0} forwardOnly{1}
    bit(1) playbackOrder;
}
class attr_syncBehaviorDefault {
    // Enumeration: canSlip{0} independent{1} inherit{2} locked{3}
    bit(2) syncBehaviorDefault;
}
class attr_syncToleranceDefault {
    bit(1) choice;
    switch(choice) {
      case 0:
        vluimsbf5 vluimsbf50;
        break;
      case 1:
          // Enumeration: inherit{0}
        break;
      default:
        break;
      }
}
class attr_timeLineBegin {
    // Enumeration: onLoad{0} onStart{1}
    bit(1) timeLineBegin;
}
class attr_viewBox {
  int max=+4;
  for (int t=0;t<max;t++) {
    attr_custom_fixed_16_8 item[[t]];
  }
}
class attr_zoomAndPan {
    // Enumeration: disable{0} magnify{1}
    bit(1) zoomAndPan;
}
class attr_point {
  int max=+2;
  for (int t=0;t<max;t++) {
    attr_custom_coordinate item[[t]];
  }
}
class attr_choice {
    bit(1) choice;
    switch(choice) {
      case 0:
        bit(8) value;
        break;
      case 1:
          // Enumeration: all{0} none{1}
          bit(1) choice;
        break;
      }
}
class attr_coordinateList {
  vluimsbf5 len;
  for (int t = 0; t < len; t++) {
    attr_custom_coordinate coord[[t]];
  }
}


class attr_scrollStop {
  bit(1) choice;
  switch(choice) {
    case 0:
      attr_custom_IDREF IDREF0;
      break;
    case 1:
      int max=+2;
      for (int t=0;t<max;t++) {
        attr_custom_fixed_16_8 item[[t]];
      }
      break;
  }
}
class attr_direction {
  // Enumeration: down{0} left{1} right{2} up{3}
  bit(4) direction;
}
class attr_streamSourceMode {
  // Enumeration: keepOld{0} playList{1} replace{2} useOld{3}
    bit(3) streamSourceMode;
}
class attr_sources {
  vluimsbf5 max;
  for (int t=0;t<max;t++) {
    attr_custom_anyURI item[[t]];
  }
}



class attr_custom_ID {
    vluimsbf5 ID;
    bit(1) reserved;
    if (reserved) {
        vluimsbf5 len;
        bit[len] reserved;
    }
}
class attr_custom_IDREF {
    vluimsbf5 href;
    bit(1) reserved;
    if (reserved) {
        vluimsbf5 len;
        bit[len] reserved;
    }
}
class attr_custom_anyURI {
    bit(1) hasUri;
    if (hasUri) {
        attr_custom_byteAlignedString uri;
        bit(1) hasData; // for a data URL, the actual data part is sent below, the header is sent in the uri field
        if (hasData) {
            vluimsbf5 len;
            byte[len] data;
        }
    }
    bit(1) hasID;
    if (hasID) {
        attr_custom_IDREF idref;
    }
    bit(1) hasStreamID;
    if (hasStreamID) {
        attr_custom_IDREF ref;
    }
}
class attr_custom_paint {
  bit(1) hasIndex;
  if (hasIndex) {
    uint(colorIndexBits) color0;
  } else {
      bit(2) ch2;
      switch(ch2) {
        case 0: // enum
         //Enumeration: inherit{0} currentColor{1} none{2}
        bit(2) color;
          break;
        case 1: // URI
              attr_custom_anyURI uri;
          break;
        case 2: // System Paint Server
          attr_custom_byteAlignedString serverName;
          break;
        case 3:
            attr_custom_extension colorExType0; // extensibility
          break;
      }
  }
}
class custom_matrix {
    bit(1) isNotMatrix;
    if (isNotMatrix) {
      bit(1) isRef; // modification for the encoding of ref(svg[,x,y])
      if (isRef) {
        bit(1) hasXY;
        if (hasXY) {
          attr_custom_fixed_16_8 valueX;
          attr_custom_fixed_16_8 valueY;
        }
      } else {
        attr_custom_extension ext;
      }
    } else {
      bit(1) xx_yy_present;
      if (xx_yy_present) {
          uint(coordBits+scaleBits_minus_coordBits) xx;
          uint(coordBits+scaleBits_minus_coordBits) yy;
      }
      bit(1) xy_yx_present;
      if (xy_yx_present) {
          uint(coordBits+scaleBits_minus_coordBits) xy;
          uint(coordBits+scaleBits_minus_coordBits) yx;
      }
      bit(1) xz_yz_present;
      if (xz_yz_present) {
          uint(coordBits+scaleBits_minus_coordBits) xz;
          uint(coordBits+scaleBits_minus_coordBits) yz;
      }
    }
}
class attr_custom_0to1float {
    uint(8) quantifiedValue; // uniform quantization of a float between 0 and 1
}
class attr_custom_path {
    attr_custom_pointSequence seq;
    vluimsbf5 nbOfTypes;
    for (int i = 0; i < nbOfTypes; i++) {
        // Enumeration: "pathSegmentTypes" C{0} H{1} L{2} M{3} Q{4} S{5} T{6} V{7} Z{8} c{9} h{10} l{11} m{12} q{13} s{14} t{15} v{16} z{17}
        uint(5) type[[i]];
    }
}

class attr_custom_pointSequence {
    vluimsbf5 nbPoints;
    uint(1) flag;
    if (flag == 0) {
        if (nbPoints < 3) {
            uint(5) bits;
            for (int i = 0; i < nbPoints; i++) {
                uint(bits) x[[i]];
                uint(bits) y[[i]];
            }
        } else {
            uint(5) bits;
            uint(bits) x[0];
            uint(bits) y[0];
            uint(5) bitsx;
            uint(5) bitsy;
            for (int i = 1; i < nbPoints; i++) {
                uint(bitsx) dx;
                uint(bitsy) dy;
                x[i] = dx + x[i-1];
                y[i] = dy + y[i-1];
            }
        }
    } else {
      if (pointsCodec == 0) { // pointsCodec is a LASeRHeader attribute
        uint(4) kvalue;
        uint(5) bits;
        uint(bits) x[0];
        uint(bits) y[0];
        int XMvalue,YMvalue = 0;
        int CodeNum = 0;
        int Diff =0;
        for(int i=1; i < nbPoints; i++) {
            // to calculate X point
            do {
                bit(1) bitX;
                XMvalue ++;
            } while (bitX == 0);
        const bit(1) endX = 1;
            uint(XMvalue+kvalue) INFO_dx;
            CodeNum = GetCodeNum(kvalue, XMvalue, INFO_dx);
            Diff = GetDiff(CodeNum);
            x[i] = x[i-1] + Diff;
            // to calculate Y point
            do {
                bit(1) bitY;
                YMvalue ++;
            } while (bitY == 0);
        const bit(1) endY = 1;
            uint(YMvalue+kvalue) INFO_dy;
            CodeNum = GetCodeNum(kvalue, YMvalue, INFO_dy);
            Diff = GetDiff(CodeNum);
            y[i] = y[i-1] + Diff;
        }
    } else {
        attr_custom_extension ext; 
    }
  }
}

uint GetDiff(int codeNum){
      int diff;
      if (codeNum == 0) {
          diff = 0;
          return diff;
      } else {
            if ((codeNum%2) == 0 ) {
                diff = -codeNum/2;
                return diff;
            }
            else {
                diff = (codeNum+1)/2;
                return diff;
            }            
      }
}

uint GetCodeNum(int k, int Mvalue, int INFO){
    return 2^(k+Mvalue) + INFO - 2^k ;
}
class attr_custom_valueWithUnits {
    uint(32) value; // float represented as fixed point with 8 bits mantissa
    uint(3) units; // 0 no unit or px, 1 'in', 2 'cm', 3 'mm', 4 'pt', 5 'pc', 6 '%'
}
class attr_custom_AnimatedValues {
    uint(4) type;
    vluimsbf5 nbValue;
    for (int i=0; i < nbValue; i++) {
      bit(1) escapeFlag[[i]];
      if (escapeFlag[[i]]) {
          // case for inherit and other mixed enum+number cases
          bit(2) escapeEnum[[i]];
      } else {
        switch(type) {
          case 0: // string
              attr_custom_byteAlignedString value[[i]];
              break;
          case 1: // float
              attr_custom_fixed_16_8 value[[i]];
              break;
          case 12:
              attr_custom_anyURI value[[i]];
              break;
          case 2: // path
              attr_custom_path value[[i]];
              break;
          case 3: // pointSeq
               attr_custom_pointSequence value[[i]];
              break;
          case 4: // fraction
              attr_custom_0to1float value[[i]];
              break;
          case 5: // color
              attr_custom_paint value[[i]];
              break;
          case 6: // enum
          case 10: // id
              vluimsbf5 value[[i]];
              break;
          case 11: // font
              vluimsbf5 j;
              value[i] = fontTable[j];
              break;
          case 7: // ints
              vluimsbf5 nbInts;
              for (int k = 0; k < nbInts; k++) {
                  vluimsbf5 value[[i]][[k]];
              }
              break;
          case 8: // floats
              vluimsbf5 nbFloats;
              for (int k = 0; k < nbFloats; k++) {
                  attr_custom_fixed_16_8 value[[i]][[k]];
              }
              break;
          case 9: // point
              attr_custom_coordinate valueX[[i]];
              attr_custom_coordinate valueY[[i]];
              break;
          default:
              attr_custom_extension privateData;
              break;
        }
    }
  }
}

class attr_custom_AnimatedValue {
  uint(4) type;
  bit(1) escapeFlag;
  if (escapeFlag) {
      // case for inherit and other mixed enum+number cases
      bit(2) escapeEnum;
  } else {
       switch(type) {
        case 0:
            attr_custom_byteAlignedString value;
            break;
        case 1:
            attr_custom_fixed_16_8 value;
            break;
        case 12:
            attr_custom_anyURI value;
            break;
        case 2:
            attr_custom_path value;
            break;
        case 3:
            attr_custom_pointSequence value;
            break;
        case 4:
            attr_custom_0to1float value;
            break;
        case 5:
            attr_custom_paint value;
            break;
        case 6: // enum
        case 10: // id
            vluimsbf5 value;
            break;
        case 11: // font
            vluimsbf5 j;
            value = fontTable[j];
            break;
        case 7: // ints
            vluimsbf5 nbInts;
            for (int k = 0; k < nbInts; k++) {
                vluimsbf5 value[[k]];
            }
            break;
        case 8: // floats
            vluimsbf5 nbFloats;
            for (int k = 0; k < nbFloats; k++) {
                attr_custom_fixed_16_8 value[[k]];
            }
            break;
        case 9: // point
            attr_custom_coordinate valueX;
            attr_custom_coordinate valueY;
            break;
        default:
            attr_custom_extension privateData;
            break;
      }
  }
} 
class attr_custom_byteAlignedString {
    aligned vluimsbf8 slen;
    byte[slen] UTF-8string;
}
class attr_custom_fixed_16_8 {
    int(24) float; // float represented as fixed point with 16 bits mantissa
}
class attr_custom_coordinate {
  uint(coordBits) coord;
}
const int TYPE_boolean = 0;
const int TYPE_enum = 1;
const int TYPE_color = 2;
const int TYPE_fraction = 3;
const int TYPE_float = 4;
const int TYPE_time = 5;
const int TYPE_point = 6;
const int TYPE_matrix = 7;
const int TYPE_string = 8;
const int TYPE_points = 9;
const int TYPE_path = 10;
const int TYPE_ints = 11;
const int TYPE_floats = 12;
const int TYPE_smil_times = 13;
const int TYPE_unit = 14;
const int TYPE_index = 15;
const int TYPE_URI = 16;
const int TYPE_ID = 17;
const int TYPE_event = 18;
const int TYPE_scale = 19;
const int TYPE_coordinate = 20;
const int TYPE_keyTimes = 21;

const int updateTypeOfAttribute[] = {
        TYPE_string, // a.target
        TYPE_boolean, // accumulate
        TYPE_boolean, // additive
        TYPE_fraction, // audio-level
        TYPE_float, // bandwidth
        TYPE_smil_times, // begin
        TYPE_enum, // calcMode
        -1, // children
        TYPE_index, // choice
        TYPE_time, // clipBegin
        TYPE_time, // clipEnd
        TYPE_color, // color
        TYPE_enum, // color-rendering
        TYPE_coordinate, // cx
        TYPE_coordinate, // cy
        TYPE_path, // d
        TYPE_floats, //delta
        TYPE_enum, // display
        TYPE_enum, // display-align
        TYPE_time, // dur
        TYPE_boolean, // editable
        TYPE_boolean, // enabled
        TYPE_smil_times, // end
        TYPE_event, // event
        TYPE_boolean, // externalResourcesRequired
        TYPE_color, // fill
        TYPE_fraction, // fill-opacity
        TYPE_enum, // fill-rule
        TYPE_enum, // focusable
        TYPE_index, // font-family
        TYPE_float, // font-size
        TYPE_enum, // font-style
        TYPE_enum, // font-variant
        TYPE_enum, // font-weight
        TYPE_boolean, // fullscreen
        TYPE_enum, // gradient-units
        TYPE_ID, // handler
        TYPE_coordinate, // height
        TYPE_enum, // image-rendering
        TYPE_floats, // keyPoints
        TYPE_floats, // keySplines
        TYPE_keyTimes, // keyTimes
        TYPE_float, // line-increment
        TYPE_ID, // listener.target
        TYPE_string, // mediaCharacterEncoding
        TYPE_string, // mediaContentEncodings
        TYPE_float, // mediaSize
        TYPE_time, // mediaTime
        TYPE_ID, // nav-down
        TYPE_ID, // nav-down-left
        TYPE_ID, // nav-down-right
        TYPE_ID, // nav-left
        TYPE_ID, // nav-next
        TYPE_ID, // nav-prev
        TYPE_ID, // nav-right
        TYPE_ID, // nav-up
        TYPE_ID, // nav-up-left
        TYPE_ID, // nav-up-right
        TYPE_ID, // observer
        TYPE_fraction, // offset
        TYPE_fraction, / opacity
        TYPE_enum, // overflow
        TYPE_enum, // overlay
        TYPE_path, // path
        TYPE_float, // pathLength
        TYPE_enum, // pointer-events
        TYPE_points, // points
        -1, // preserveAspectRatio
        TYPE_coordinate, // r
        TYPE_float, // repeatCount
        TYPE_time, // repeatDur
        TYPE_string, // requiredExtensions
        TYPE_ints, // requiredFeatures
        TYPE_string, // requiredFormats
        TYPE_enum, // restart
        TYPE_floats, // rotate
        TYPE_float, // rotation
        TYPE_coordinate, // rx
        TYPE_coordinate, // ry
        TYPE_scale, // scale
        TYPE_enum, // shape-rendering
        TYPE_point, // size
        TYPE_color, // solid-color
        TYPE_fraction, // solid-opacity
        TYPE_color, // stop-color
        TYPE_fraction, // stop-opacity
        TYPE_color, // stroke
        TYPE_floats, // stroke-dasharray
        TYPE_float, // stroke-dashoffset
        TYPE_enum, // stroke-linecap
        TYPE_enum, // stroke-linejoin
        TYPE_float, // stroke-miterlimit
        TYPE_fraction, // stroke-opacity
        TYPE_float, // stroke-width
        TYPE_unit, // svg.height
        TYPE_unit, // svg.width
        TYPE_enum, // syncBehavior
        TYPE_enum, // syncBehaviorDefault
        TYPE_URI, // syncReference
        TYPE_float, // syncTolerance
        TYPE_float, // syncToleranceDefault
        TYPE_string, // systemLanguage
        TYPE_enum, // text-align
        TYPE_enum, // text-anchor
        TYPE_enum, // text-decoration
        TYPE_enum, // text-rendering
        TYPE_string, // textContent
        TYPE_matrix, // transform
        TYPE_enum, // transformBehavior
        TYPE_point, // translation
        TYPE_enum, // vector-effect,
        TYPE_floats, // viewBox
        TYPE_color, // viewport-fill
        TYPE_fraction, // viewport-fill-opacity
        TYPE_enum, // visibility
        TYPE_coordinate, // width
        TYPE_coordinate, // x
        TYPE_coordinate, // x1
        TYPE_coordinate, // x2
        TYPE_enum, // xlink:actuate
        TYPE_string, // xlink:arcrole
        TYPE_URI, // xlink:href
        TYPE_string, // xlink:role
        TYPE_enum, // xlink:show
        TYPE_string, // xlink:title
        TYPE_enum, // xlink:type
        TYPE_string, // xml:base
        TYPE_string, // xml:lang
        TYPE_coordinate, // y
        TYPE_coordinate, // y1
        TYPE_coordinate, // y2
        TYPE_boolean // zoomAndPan
    };

const int ITYPE_point = 0;
const int ITYPE_int = 1;
const int ITYPE_float = 2;
const int ITYPE_keyTime = 3;
const int ITYPE_0to1 = 4;
const int ITYPE_smil_time = 5;

const int indexedTypeOfAttribute[] = {
        -1, // a.target
        -1, // accumulate
        -1, // additive
        -1, // audio-level
        -1, // bandwidth
        ITYPE_smil_time, // begin
        -1, // calcMode
        -1, // children
        -1, // choice
        -1, // clipBegin
        -1, // clipEnd
        -1, // color
        -1, // color-rendering
        -1, // cx
        -1, // cy
        -1, // d
        -1, // delta
        -1, // display
        -1, // display-align
        -1, // dur
        -1, // editable
        -1, // enabled
        ITYPE_smil_time, // end
        -1, // event
        -1, // externalResourcesRequired
        -1, // fill
        -1, // fill-opacity
        -1, // fill-rule
        -1, // focusable
        -1, // font-family
        -1, // font-size
        -1, // font-style
        -1, // font-variant
        -1, // font-weight
        -1, // fullscreen
        -1, // gradient-units
        -1, // handler
        -1, // height
        -1, // image-rendering
        ITYPE_0to1, // keyPoints
        ITYPE_float, // keySplines
        ITYPE_keyTime, // keyTimes
        -1, // line-increment
        -1, // listener.target
        -1, // mediaCharacterEncoding
        -1, // mediaContentEncodings
        -1, // mediaSize
        -1, // mediaTime
        -1, // nav-down
        -1, // nav-down-left
        -1, // nav-down-right
        -1, // nav-left
        -1, // nav-next
        -1, // nav-prev
        -1, // nav-right
        -1, // nav-up
        -1, // nav-up-left
        -1, // nav-up-right
        -1, // observer
        -1, // offset
        -1, // opacity
        -1, // overflow
        -1, // overlay
        -1, // path
        -1, // pathLength
        -1, // pointer-events
        ITYPE_point, // points
        -1, // preserveAspectRatio
        -1, // r
        -1, // repeatCount
        -1, // repeatDur
        -1, // requiredExtensions
        ITYPE_int, // requiredFeatures
        -1, // requiredFormats
        -1, // restart
        -1, // rotate
        -1, // rotation
        -1, // rx
        -1, // ry
        -1, // scale
        -1, // shape-rendering
        -1, // size
        -1, // solid-color
        -1, // solid-opacity
        -1, // stop-color
        -1, // stop-opacity
        -1, // stroke
        ITYPE_float, // stroke-dasharray
        -1, // stroke-dashoffset
        -1, // stroke-linecap
        -1, // stroke-linejoin
        -1, // stroke-miterlimit
        -1, // stroke-opacity
        -1, // stroke-width
        -1, // svg.height
        -1, // svg.width
        -1, // syncBehavior
        -1, // syncBehaviorDefault
        -1, // syncReference
        -1, // syncTolerance
        -1, // syncToleranceDefault
        -1, // systemLanguage
        -1, // text-align
        -1, // text-anchor
        -1, // text-decoration
        -1, // text-rendering
        -1, // textContent
        -1, // transform
        -1, // transformBehavior
        -1, // translation
        -1, // vector-effect
        ITYPE_float, // viewBox
        -1, // viewport-fill
        -1, // viewport-fill-opacity
        -1, // visibility
        -1, // width
        -1, // x
        -1, // x1
        -1, // x2
        -1, // xlink:actuate
        -1, // xlink:arcrole
        -1, // xlink:href
        -1, // xlink:role
        -1, // xlink:show
        -1, // xlink:title
        -1, // xlink:type
        -1, // xml:base
        -1, // xml:lang
        -1, // y
        -1, // y1
        -1, // y2
        -1 // zoomAndPan
    };


class attr_custom_updateValue {
    if (updateHasIndex) { // is the hasIndex bit set in the update ? false if not in an update
        // indexed
        switch(indexedTypeOfAttribute[attributeIndex]) {
            case ITYPE_point:
                attr_custom_coordinate pointValueX;
                attr_custom_coordinate pointValueY;
                break;
            case ITYPE_int:
                byte intValue;
                break;
            case ITYPE_float:
                attr_custom_fixed_16_8 floatValue;
                break;
            case ITYPE_keyTime:
                bit(1) hasShort;
                if (hasShort) {
                  bit(1) isZero;
                  if (isZero) {
                    timevalue = 0;
                  } else {
                    timevalue = 1;
                  }
                } else {
                  uint(12) timevalue; // 0 to 1 float encoded on 12 bits
                }
                break;
            case ITYPE_smil_time:
                custom_smil_time timevalue;
                break;
            case ITYPE_0to1:
                attr_custom_0to1float valueX;
                attr_custom_0to1float valueY;
                break;
            default:
                attr_custom_extension privateData;
                break;
        }
    } else {
      switch(updateTypeOfAttribute[attributeIndex]) {
        case TYPE_boolean:
           bit(1) booleanvalue;
           break;
        case TYPE_enum:
           bit(1) isDefaultValue; // default value (inherit, auto, default ...)
           if (!isDefaultValue) {
             vluimsbf5 enumValue;
           }
           break;
        case TYPE_index:
           bit(1) isDefaultValue; // default value (inherit, auto, default ...)
           if (!isDefaultValue) {
               bit(1) escapeFlag;
               if (escapeFlag) {
                 // case for mixed enum+number cases
                 bit(2) escapeEnumVal;
               } else {
                 vluimsbf5 indexValue;
               }
           }
           break;
        case TYPE_ID:
           bit(1) isDefaultValue; // default value (inherit, auto, default ...)
           if (!isDefaultValue) {
               bit(1) escapeFlag;
               if (escapeFlag) {
                 // case for mixed enum+ID cases
                 bit(2) escapeEnumVal;
               } else {
                   vluimsbf5 IDValue;
               }
           }
           break;
        case TYPE_color:
           attr_custom_paint colorValue;
           break;
        case TYPE_fraction:
           bit(1) isDefaultValue; // default value (inherit, auto, default ...)
           if (!isDefaultValue) {
               attr_custom_0to1float fractionValue;
           }
           break;
        case TYPE_float:
           bit(1) isDefaultValue; // default value (inherit, auto, default ...)
           if (!isDefaultValue) {
               bit(1) escapeFlag;
               if (escapeFlag) {
                 // case for mixed enum+float cases
                 bit(2) escapeEnumVal;
               } else {
                   attr_custom_fixed_16_8 floatValue;
               }
           }
           break;
        case TYPE_time:
           attr_time timeValue;
           break;
        case TYPE_point:
           attr_custom_coordinate pointValueX;
           attr_custom_coordinate pointValueY;
           break;
        case TYPE_matrix:
           custom_matrix matrixValue;
           break;
        case TYPE_string:
           attr_custom_byteAlignedString stringValue;
           break;
        case TYPE_points:
           attr_custom_pointSequence pointValues;
           break;
        case TYPE_path:
           attr_custom_path pathValue;
           break;
        case TYPE_ints:
           vluimsbf5 nb;
           for (int i = 0; i < nb; i++) {
              uint(8) intValue[[i]];
           }
           break;
        case TYPE_floats:
           bit(1) isDefaultValue; // only for stroke-dasharray inherit
           if (!isDefaultValue) {
               bit(1) escapeFlag;
               if (escapeFlag) { // only for stroke-dasharray none
                 bit(2) escapeEnumVal;
               } else {
                   vluimsbf5 nb1;
                   for (int i = 0; i < nb1; i++) {
                      attr_custom_fixed_16_8 floatValue[[i]];
                   }
               }
           }
           break;
        case TYPE_keyTimes:
           attr_custom_fraction12List timeValues;
           break;
        case TYPE_smil_times:
           attr_smil_times timeValues1;
           break;
        case TYPE_unit:
           attr_custom_valueWithUnits unitValue;
           break;
        case TYPE_URI:
           attr_custom_anyURI uri;
           break;
        case TYPE_event:
           attr_custom_event event;
           break;
        case TYPE_scale:
           attr_custom_fixed_16_8 scaleX;
           attr_custom_fixed_16_8 scaleY;
           break;
        case TYPE_coordinate:
           attr_custom_coordinate value;
           break;
        default:
           attr_custom_extension privateData;
           break;
    }
  }
}
class attr_custom_fraction12List {
    vluimsbf5 len;
    for (int i = 0; i < len; i++) {
      bit(1) hasShort;
      if (hasShort) {
        bit(1) isZero;
        if (isZero) {
            float[i] = 0;
        } else {
            float[i] = 1;
        }
      } else {
        uint(12) float[[i]]; // 0 to 1 float encoded on 12 bits
      }
    }
}
class attr_custom_event {
  bit(1) choice;
  switch(choice) {
    case 0:
      attr_custom_byteAlignedString string0;
      break;
    case 1:
      // Enumeration: abort{0} accessKey{1} activate{2} activatedEvent{3} beginEvent{4} click{5} deactivatedEvent{6} endEvent{7} error{8} executionTime{9} focusin{10} focusout{11} keydown{12} keyup{13} load{14} longAccessKey{15} mousedown{16} mousemove{17} mouseout{18} mouseover{19} mouseup{20} pause{21} pausedEvent{22} play{23} repeatEvent{24} repeatKey{25} resize{26} resumedEvent{27} scroll{28} shortAccessKey{29} textinput{30} unload{31} zoom{32}
      bit(6) event;
      switch (event) {
        case 1:  //accessKey
        case 15: //longAccessKey
        case 29: //shortAccessKey
        case 25: //repeatKey
          // Enumeration: *{0} 0{1} 1{2} 2{3} 3{4} 4{5} 5{6} 6{7} 7{8} 8{9} 9{10} ANY_KEY{11} DOWN{12} FIRE{13} LEFT{14} NO_KEY{15} RIGHT{16} SHARP{17} SOFT_KEY_1{18} SOFT_KEY_2{19} UP{20}
          vluimsbf5 keyCode;
          break;
      }
      break;
  }
}
//indexes for rare attributes
const int RARE_CLASS = 0;
const int RARE_AUDIO_LEVEL = 1;
const int RARE_COLOR = 2;
const int RARE_COLOR_RENDERING = 3;
const int RARE_DISPLAY = 4;
const int RARE_DISPLAY_ALIGN = 5;
const int RARE_FILL_OPACITY = 6;
const int RARE_FILL_RULE = 7;
const int RARE_IMAGE_RENDERING = 8;
const int RARE_LINE_INCREMENT = 9;
const int RARE_POINTER_EVENTS = 10;
const int RARE_SHAPE_RENDERING = 11;
const int RARE_SOLID_COLOR = 12;
const int RARE_SOLID_OPACITY = 13;
const int RARE_STOP_COLOR = 14;
const int RARE_STOP_OPACITY = 15;
const int RARE_STROKE_DASHARRAY = 16;
const int RARE_STROKE_DASHOFFSET = 17;
const int RARE_STROKE_LINECAP = 18;
const int RARE_STROKE_LINEJOIN = 19;
const int RARE_STROKE_MITERLIMIT = 20;
const int RARE_STROKE_OPACITY = 21;
const int RARE_STROKE_WIDTH = 22;
const int RARE_TEXT_ANCHOR = 23;
const int RARE_TEXT_RENDERING = 24;
const int RARE_VIEWPORT_FILL = 25;
const int RARE_VIEWPORT_FILL_OPACITY = 26;
const int RARE_VECTOR_EFFECT = 27;
const int RARE_VISIBILITY = 28;
const int RARE_REQUIREDEXTENSIONS = 29;
const int RARE_REQUIREDFEATURES = 30;
const int RARE_REQUIREDFORMATS = 31;
const int RARE_SYSTEMLANGUAGE =32;
const int RARE_XML_BASE = 33;
const int RARE_XML_LANG = 34;
const int RARE_XML_SPACE = 35;
const int RARE_FOCUSNEXT = 36;
const int RARE_FOCUSNORTH = 37;
const int RARE_FOCUSNORTHEAST = 38;
const int RARE_FOCUSNORTHWEST = 39;
const int RARE_FOCUSPREV = 40;
const int RARE_FOCUSSOUTH = 41;
const int RARE_FOCUSSOUTHEAST = 42;
const int RARE_FOCUSSOUTHWEST = 43;
const int RARE_FOCUSWEST = 44;
const int RARE_FOCUSABLE = 45;
const int RARE_FOCUSEAST = 46;
const int RARE_TRANSFORM = 47;
const int RARE_TEXT_DECORATION = 48; //DCOR
const int RARE_EXTENSION = 49; //DCOR
const int RARE_FONT_VARIANT = 50;
const int RARE_FONT_FAMILY = 51;
const int RARE_FONT_SIZE = 52;
const int RARE_FONT_STYLE = 53;
const int RARE_FONT_WEIGHT = 54;
const int RARE_HREF_TITLE = 55;
const int RARE_HREF_TYPE = 56;
const int RARE_HREF_ROLE = 57;
const int RARE_HREF_ARCROLE = 58;
const int RARE_HREF_ACTUATE = 59;
const int RARE_HREF_SHOW = 60;
const int RARE_END = 61;
const int RARE_MAX = 62;
const int RARE_MIN = 63;
//rare AMD1
const int RARE_SYNCMASTER = 0;
const int RARE_FOCUSHIGHLIGHT = 1;
const int RARE_INITIALVISIBILITY = 2;
const int RARE_FULLSCREEN = 3;
const int RARE_REQUIREDFONTS = 4;
const int RARE_ACTIVE = 5;

class attr_custom_rare {
  uint(6) nbOfAttributes;
  for(int i = 0; i < nbOfAttributes; i++) {
    uint(6) attributeRARE;
    switch(attributeRARE) {
      case RARE_CLASS:
        attr_custom_byteAlignedString class;
        break;
      case RARE_AUDIO_LEVEL:
        attr_custom_0to1float audio-level;
        break;
      case RARE_COLOR:
        attr_custom_paint color;
        break;
      case RARE_COLOR_RENDERING:
        // Enumeration: auto{0} inherit{1} optimizeQuality{2} optimizeSpeed{3}
        bit(2) color-rendering;
        break;
      case RARE_DISPLAY:
        // Enumeration: block{0} compact{1} inherit{2} inline{3} inline-table{4} list-item{5} marker{6} none{7} run-in{8} table{9} table-caption{10} table-cell{11} table-column{12} table-column-group{13} table-footer-group{14} table-header-group{15} table-row{16} table-row-group{17}
        bit(5) display;
        break;
      case RARE_DISPLAY_ALIGN:
        // Enumeration: after{0} auto{1} before{2} center{3} inherit{4}
        bit(3) displayAlign;
        break;
      case RARE_FILL_OPACITY:
        attr_custom_0to1float f;
        break;
      case RARE_FILL_RULE:
        // Enumeration: evenodd{0} inherit{1} nonzero{2}
        bit(2) fill-rule;
        break;
      case RARE_IMAGE_RENDERING:
        // Enumeration: auto{0} inherit{1} optimizeQuality{2} optimizeSpeed{3}
        bit(2) image-rendering;
        break;
      case RARE_LINE_INCREMENT:
        bit(1) choice;
        switch(choice) {
          case 0:
            attr_custom_fixed_16_8 line-increment;
            break;
          case 1:
            // Enumeration: auto{0} inherit{1}
            bit(1) line-increment;
            break;
          default:
            break;
        }
        break;
      case RARE_POINTER_EVENTS:
        // Enumeration: all{0} boundingBox{1} fill{2} inherit{3} none{4} painted{5} stroke{6} visible{7} visibleFill{8} visiblePainted{9} visibleStroke{10}
        bit(4) pointer-events;
        break;
      case RARE_SHAPE_RENDERING:
        // Enumeration: auto{0} crispEdges{1} geometricPrecision{2} inherit{3} optimizeSpeed{4}
        bit(3) shape-rendering;
        break;
      case RARE_SOLID_COLOR:
        attr_custom_paint color;
        break;
      case RARE_SOLID_OPACITY:
        attr_custom_0to1float opacity;
        break;
      case RARE_STOP_COLOR:
        attr_custom_paint color;
        break;
      case RARE_STOP_OPACITY:
        attr_custom_0to1float opacity;
        break;
      case RARE_STROKE_DASHARRAY:
        bit(1) isInherit;
        if (!isInherit) {
            vluimsbf5 max;
            for (int i = 0; i < max; i++) {
                attr_custom_fixed_16_8 dash[[i]];
            }
        }
        break;
      case RARE_STROKE_DASHOFFSET:
        custom_fixed_16_8i dashOffset;
        break;
      case RARE_STROKE_LINECAP:
        // Enumeration: butt{0} inherit{1} round{2} square{3}
        bit(2) stroke-linecap;
        break;
      case RARE_STROKE_LINEJOIN:
        // Enumeration: bevel{0} inherit{1} miter{2} round{3}
        bit(2) stroke-linejoin;
        break;
      case RARE_STROKE_MITERLIMIT:
        custom_fixed_16_8i miterlimit;
        break;
      case RARE_STROKE_OPACITY:
        attr_custom_0to1float opacity;
        break;
      case RARE_STROKE_WIDTH:
        custom_fixed_16_8i width;
        break;
      case RARE_TEXT_ANCHOR:
        // Enumeration: end{0} inherit{1} middle{2} start{3}
        bit(2) textAnchor;
      case RARE_TEXT_RENDERING:
        // Enumeration: auto{0} geometricPrecision{1} inherit{2} optimizeLegibility{3} optimizeSpeed{4}
        bit(3) text-rendering;
        break;
      case RARE_VIEWPORT_FILL:
        attr_custom_paint color;
        break;
      case RARE_VIEWPORT_FILL_OPACITY:
        attr_custom_0to1float opacity;
        break;
      case RARE_VECTOR_EFFECT:
        // Enumeration: default{0} inherit{1} non-scaling-stroke{2}
        bit(4) vector-effect;
        break;
      case RARE_VISIBILITY:
        // Enumeration: hidden{0} inherit{1} visible{2}
        bit(2) visibility;
        break;
      case RARE_REQUIREDEXTENSIONS:
        attr_custom_byteAlignedString string;
        break;
      case RARE_REQUIREDFEATURES:
        vluimsbf5 max;
        for (int t=0;t<max;t++) {
          // Enumeration: 
        	http://www.w3.org/Graphics/SVG/feature/1.2/#Animation{0} 
        	http://www.w3.org/Graphics/SVG/feature/1.2/#Audio{1} 
        	http://www.w3.org/Graphics/SVG/feature/1.2/#ComposedVideo{2} 
        	http://www.w3.org/Graphics/SVG/feature/1.2/#ConditionalProcessing{3} 
        	http://www.w3.org/Graphics/SVG/feature/1.2/#ConditionalProcessingAttribute{4} 
        	http://www.w3.org/Graphics/SVG/feature/1.2/#CoreAttribute{5} 
        	http://www.w3.org/Graphics/SVG/feature/1.2/#Discard{6} 
        	http://www.w3.org/Graphics/SVG/feature/1.2/#Extensibility{7} 
        	http://www.w3.org/Graphics/SVG/feature/1.2/#ExternalResourcesRequired{8} 
        	http://www.w3.org/Graphics/SVG/feature/1.2/#Font{9} 
        	http://www.w3.org/Graphics/SVG/feature/1.2/#Gradient{10} 
        	http://www.w3.org/Graphics/SVG/feature/1.2/#GraphicsAttribute{11} 
        	http://www.w3.org/Graphics/SVG/feature/1.2/#Handler{12} 
        	http://www.w3.org/Graphics/SVG/feature/1.2/#Hyperlinking{13} 
        	http://www.w3.org/Graphics/SVG/feature/1.2/#Image{14} 
        	http://www.w3.org/Graphics/SVG/feature/1.2/#Listener{15} 
        	http://www.w3.org/Graphics/SVG/feature/1.2/#MediaAttribute{16} 
        	http://www.w3.org/Graphics/SVG/feature/1.2/#NavigationAttribute{17} 
        	http://www.w3.org/Graphics/SVG/feature/1.2/#OpacityAttribute{18} 
        	http://www.w3.org/Graphics/SVG/feature/1.2/#PaintAttribute{19} 
        	http://www.w3.org/Graphics/SVG/feature/1.2/#Prefetch{20} 
        	http://www.w3.org/Graphics/SVG/feature/1.2/#SVG-all{21} 
        	http://www.w3.org/Graphics/SVG/feature/1.2/#SVG-animated{22} 
        	http://www.w3.org/Graphics/SVG/feature/1.2/#SVG-static{23} 
        	http://www.w3.org/Graphics/SVG/feature/1.2/#SVG-static-DOM{24} 
        	http://www.w3.org/Graphics/SVG/feature/1.2/#Scripting{25} 
        	http://www.w3.org/Graphics/SVG/feature/1.2/#Shape{26} 
        	http://www.w3.org/Graphics/SVG/feature/1.2/#SolidColor{27} 
        	http://www.w3.org/Graphics/SVG/feature/1.2/#Structure{28} 
        	http://www.w3.org/Graphics/SVG/feature/1.2/#Text{29} 
        	http://www.w3.org/Graphics/SVG/feature/1.2/#TextFlow{30} 
        	http://www.w3.org/Graphics/SVG/feature/1.2/#TimedAnimation{31} 
        	http://www.w3.org/Graphics/SVG/feature/1.2/#TransformedVideo{32} 
        	http://www.w3.org/Graphics/SVG/feature/1.2/#Video{33} 
        	http://www.w3.org/Graphics/SVG/feature/1.2/#XlinkAttribute{34} 
        	http://www.w3.org/TR/SVG11/feature#Animation{35} 
        	http://www.w3.org/TR/SVG11/feature#AnimationEventsAttribute{36} 
        	http://www.w3.org/TR/SVG11/feature#BasicClip{37} 
        	http://www.w3.org/TR/SVG11/feature#BasicFilter{38} 
        	http://www.w3.org/TR/SVG11/feature#BasicFont{39} 
        	http://www.w3.org/TR/SVG11/feature#BasicGraphicsAttribute{40} 
        	http://www.w3.org/TR/SVG11/feature#BasicPaintAttribute{41} 
        	http://www.w3.org/TR/SVG11/feature#BasicStructure{42} 
        	http://www.w3.org/TR/SVG11/feature#BasicText{43} 
        	http://www.w3.org/TR/SVG11/feature#Clip{44} 
        	http://www.w3.org/TR/SVG11/feature#ColorProfile{45} 
        	http://www.w3.org/TR/SVG11/feature#ConditionalProcessing{46} 
        	http://www.w3.org/TR/SVG11/feature#ContainerAttribute{47} 
        	http://www.w3.org/TR/SVG11/feature#CoreAttribute{48} 
        	http://www.w3.org/TR/SVG11/feature#Cursor{49} 
        	http://www.w3.org/TR/SVG11/feature#DocumentEventsAttribute{50} 
        	http://www.w3.org/TR/SVG11/feature#Extensibility{51} 
        	http://www.w3.org/TR/SVG11/feature#ExternalResourcesRequired{52} 
        	http://www.w3.org/TR/SVG11/feature#Filter{53} 
        	http://www.w3.org/TR/SVG11/feature#Font{54} 
        	http://www.w3.org/TR/SVG11/feature#Gradient{55} 
        	http://www.w3.org/TR/SVG11/feature#GraphicalEventsAttribute{56} 
        	http://www.w3.org/TR/SVG11/feature#GraphicsAttribute{57} 
        	http://www.w3.org/TR/SVG11/feature#Hyperlinking{58} 
        	http://www.w3.org/TR/SVG11/feature#Image{59} 
        	http://www.w3.org/TR/SVG11/feature#Marker{60} 
        	http://www.w3.org/TR/SVG11/feature#Mask{61} 
        	http://www.w3.org/TR/SVG11/feature#OpacityAttribute{62} 
        	http://www.w3.org/TR/SVG11/feature#PaintAttribute{63} 
        	http://www.w3.org/TR/SVG11/feature#Pattern{64} 
        	http://www.w3.org/TR/SVG11/feature#SVG{65} 
        	http://www.w3.org/TR/SVG11/feature#SVG-animation{66} 
        	http://www.w3.org/TR/SVG11/feature#SVG-dynamic{67} 
        	http://www.w3.org/TR/SVG11/feature#SVG-static{68} 
        	http://www.w3.org/TR/SVG11/feature#SVGDOM{69} 
        	http://www.w3.org/TR/SVG11/feature#SVGDOM-animation{70} 
        	http://www.w3.org/TR/SVG11/feature#SVGDOM-dynamic{71} 
        	http://www.w3.org/TR/SVG11/feature#SVGDOM-static{72} 
        	http://www.w3.org/TR/SVG11/feature#Script{73} 
        	http://www.w3.org/TR/SVG11/feature#Shape{74} 
        	http://www.w3.org/TR/SVG11/feature#Structure{75} 
        	http://www.w3.org/TR/SVG11/feature#Style{76} 
        	http://www.w3.org/TR/SVG11/feature#Text{77} 
        	http://www.w3.org/TR/SVG11/feature#View{78} 
        	http://www.w3.org/TR/SVG11/feature#ViewportAttribute{79} 
        	http://www.w3.org/TR/SVG11/feature#XlinkAttribute{80} 
        	http://www.w3.org/TR/SVGMobile/Basic/feature#SVGBasicDomCore{81} 
        	http://www.w3.org/TR/SVGMobile/Basic/feature#SVGBasicDomExtended{82} 
        	http://www.w3.org/TR/SVGMobile/Basic/feature#all{83} 
        	http://www.w3.org/TR/SVGMobile/Basic/feature#base{84} 
        	http://www.w3.org/TR/SVGMobile/Basic/feature#css{85} 
        	http://www.w3.org/TR/SVGMobile/Basic/feature#interactivity{86} 
        	http://www.w3.org/TR/SVGMobile/Tiny/feature#all{87} 
        	http://www.w3.org/TR/SVGMobile/Tiny/feature#base{88} 
        	http://www.w3.org/TR/SVGMobile/Tiny/feature#interactivity{89} 
        	org.w3c.dom.svg{90} org.w3c.dom.svg.all{91} 
        	org.w3c.dom.svg.animation{92} 
        	org.w3c.dom.svg.dynamic{93} 
        	org.w3c.dom.svg.static{94} 
        	org.w3c.svg{95} 
        	org.w3c.svg.all{96} 
        	org.w3c.svg.animation{97} 
        	org.w3c.svg.dynamic{98} 
        	org.w3c.svg.static{99} 					
          bit(8) feature[[t]];
        }
        break;
      case RARE_REQUIREDFORMATS:
        attr_custom_byteAlignedString string;
        break;
      case RARE_SYSTEMLANGUAGE:
        attr_custom_byteAlignedString string;
        break;
      case RARE_XML_BASE:
        attr_custom_byteAlignedString string;
        break;
      case RARE_XML_LANG:
        attr_custom_byteAlignedString string;
        break;
      case RARE_XML_SPACE:
        // Enumeration: default{0} preserve{1}
        bit(1) space;
        break;
      case RARE_FOCUSNEXT:
        custom_focus focusNext;
        break;
      case RARE_FOCUSNORTH:
        custom_focus focusNorth;
        break;
      case RARE_FOCUSNORTHEAST:
        custom_focus focusEast;
        break;
      case RARE_FOCUSNORTHWEST:
        custom_focus focusWest;
        break;
      case RARE_FOCUSPREV:
        custom_focus focusPrev;
        break;
      case RARE_FOCUSSOUTH:
        custom_focus focusSouth;
        break;
      case RARE_FOCUSSOUTHEAST:
        custom_focus focusSouthEast;
        break;
      case RARE_FOCUSSOUTHWEST:
        custom_focus focusSouthWes;
        break;
      case RARE_FOCUSWEST:
        custom_focus focusWest;
        break;
      case RARE_FOCUSABLE:
        // Enumeration: auto{0} false{1} true{2}
        bit(2) focusable;
        break;
      case RARE_FOCUSEAST:
        custom_focus focusEast;
        break;
      case RARE_TRANSFORM:
        custom_matrix matrix;
        break;
      case RARE_FONT_VARIANT:
        // Enumeration: inherit{0} normal{1} small-caps{2}
        bit(2) font-variant;
        break;
      case RARE_FONT_FAMILY:
        bit(1) isInherit;
        if (!isInherit) {
            uint(fontIndexBits) fontIndex;
        }
        break;
      case RARE_FONT_SIZE:
        custom_fixed_16_8i size;
        break;
      case RARE_FONT_STYLE:
        // Enumeration: inherit{0} italic{1} normal{2} oblique{3}
        bit(3) font-style;
        break;
      case RARE_TEXT_DECORATION:
        // Enumeration: LASeR_EMBOSS{0} LASeR_ENGRAVE{1} LASeR_LEFTDROPSHADOW{2} LASeR_OUTLINE{3} LASeR_RIGHTDROPSHADOW{4} inherit{5} none{6} underline{7}
        bit(4) textDecoration;
        break;
      case RARE_FONT_WEIGHT:
        // Enumeration: 100{0} 200{1} 300{2} 400{3} 500{4} 600{5} 700{6} 800{7} 900{8} bold{9} bolder{10} inherit{11} lighter{12} normal{13}
        bit(4) font-weight;
        break;
      case RARE_HREF_TITLE:
        attr_custom_byteAlignedString title;
        break;
      case RARE_HREF_TYPE:
        // Enumeration: simple{0}
        bit(3) type;
        break;
      case RARE_HREF_ROLE:
        attr_custom_anyURI role;
        break;
      case RARE_HREF_ARCROLE:
        attr_custom_anyURI arcrole;
        break;
      case RARE_HREF_ACTUATE:
        // Enumeration: onLoad{0} onRequest{1}
        bit(2) actuate;
        break;
      case RARE_HREF_SHOW:
        // Enumeration: embed{0} new{1} other{2} replace{3}
        bit(3) show;
        break;
      case RARE_END:
        attr_smil_times time;
        break;
      case RARE_MAX:
        attr_time time;
        break;
      case RARE_MIN:
        attr_time time;
        break;
      case RARE_EXTENSION:
	      do {
	    		uint(extensionIDBits) extensionID;
	    		vluimsbf5 len; //length in bits
	    		if (extensionID == 2) { //LASeR AMD1
					rare2 r;
	  			} else {
	    			bit[len] toSkip;
	    		}
	    		bit(1) hasNextExtension;
	  		} while (hasNextExtension);
        break;
    }
  }
}
class rare2 {
  uint(2) nbOfAttributes;
  for(int i = 0; i < nbOfAttributes; i++) {
    uint(3) attributeRARE;
    switch(attributeRARE) {
      case RARE_SYNCMASTER:
        bit(1) syncMaster;
        break;
      case RARE_FOCUSHIGHLIGHT:
        // Enumeration: auto{0} none {1}
        bit(2) focusHighlight;
        break;
      case RARE_INITIALVISIBILITY:
        // Enumeration: whenStarted{0} always {1}
        bit(2) initialVisibility;
        break;
      case RARE_FULLSCREEN:
        // Enumeration: false(0) true(1)
        bit(2) fullscreen;
        break;
      case RARE_REQUIREDFONTS:
        attr_custom_byteAlignedString requiredFonts;
        break;
      case RARE_ACTIVE:
        bit(1) active;
        break;
    }
  }
}
class custom_focus {
    bit(1) isEnum;
    if (isEnum) {
        // Enumeration: auto{0} self{1};
        bit(1) enum;
    } else {
        attr_custom_IDREF id;
    }
}
class custom_fixed_16_8i {
  bit(1) isInherit;
  if (!isInherit) {
    int(24) float;
    }
}

class custom_smil_time {
   bit(1) hasEvent;
   if (hasEvent) {
       bit(1) hasIdentifier;
       if (hasIdentifier) {
           attr_custom_IDREF idref;
       }
       attr_custom_event event;
   }
   bit(1) hasClock;
   if (hasClock) {
       bit(1) sign; //1 is negative
       vluimsbf5 clock;
   }
}

//***********************************************************************************************
// private data and anyXML
//***********************************************************************************************

class privateAnyXMLElement {
  vluimsbf5 len; //length in bytes
  aligned privateChildren pc;
}

class privateOpaqueElement {
  vluimsbf5 len; //length in bytes
  aligned uint(privateDataIdentifierIndexBits) privateDataIdentifierIndex;
  aligned byte[len - ((privateDataIdentifierIndexBits+7)>>3)] data;
}

class privateAnyXMLAttribute {
  vluimsbf5 skipLen; //length in bytes
  aligned vluimsbf5 count;
  for (int i = 0; i < count; i++) {
    privateAttribute(0) attr[i];
    // private attribute stored in the first (0) bin, reserved for attr of LASeR elements
  }
}

class privateOpaqueAttribute {         
  vluimsbf5 len; //length in bytes
  aligned uint(privateDataIdentifierIndexBits) privateDataIdentifierIndex;
  aligned byte[len - ((privateDataIdentifierIndexBits+7)>>3)] data;
}

class privateAttribute(index) {
  uint(log2sup(nbAttrNames[index])) attrIndex;
  attr_custom_byteAlignedString value;
}

class privateChildren {
    vluimsbf5 count;
    for (int i = 0; i < count; i++) {
        bit(1) isPrivate;
        if (isPrivate) {
            bit(1) isText;
            if (isText) {
                attr_custom_byteAlignedString textContent;
            } else {
                privateElement e;
            }
        } else {
            updatable_elements child[i];
        }
    }
}

class privateElement {
  uint(tagIndexBits) tagIndex;
  bit(1) hasID;
  if (hasID) {
    attr_custom_ID ID;
  }
  vluimsbf5 alen;
  for (int i = 0; i < alen; i++ ) {
    bit(1) hasNS;
    if (hasNS) {
      privateAttribute(0) att[i];
    } else {
      privateAttribute(tagIndex) att[i];
    }
  }
  bit(1) hasChildren;
  if (hasChildren) {
    privateChildren ch;
  }
}

class attr_custom_ElementAttributeList {
  vluimsbf5 nbIds;
  for (int i = 0; i < nbIds; i++) {
      attr_custom_IDREF ref[[i]];
      attr_AttributeName attr[[i]];
    }
}
class attr_custom_align {
  aligned bit(0) dummy;
}
class attr_custom_extension {
    vluimsbf5 len;
    byte[len] privateData;
}

