Parses <Case>

        @param node: Node containing the <Case> element
        @type node: xml.etree.Element

        @raise ParseError: When no condition or value is specified
500831
def parse_case(self, node):
        
        
        try:
            condition = node.lattrib['condition']
        except:
            condition = None
            
        try:
            value = node.lattrib['value']
        except:
            self.raise_error('<Case> must specify a value')

        self.current_conditional_derived_variable.add_case(Case(condition, value))
1258337
def parse(node)
      node.attributes.each do |key, value|
        case key
        when 'color2'
          @color2 = Color.new(parent: self).parse_hex_string(value.value.split(' ').first.delete('#'))
        when 'id'
          @id = value.value.to_s
          @file = FileReference.new(parent: self).parse(node)
        when 'type'
          @type = value_to_symbol(value)
        end
      end

      node.xpath('*').each do |node_child|
        case node_child.name
        when 'patternFill'
          @pattern_fill = PatternFill.new(parent: self).parse(node_child)
        end
      end
      self
    end
1186926
def _parse_tree(self, node):
        
        self.kind = node.tag
        if 'compare' in node.attrib:
            self.compare = node.attrib['compare']
        if 'version' in node.attrib:
            self.version = node.attrib['version']
        self.value = node.text
1349414
def parse(node)
      node.xpath('*').each do |node_child|
        case node_child.name
        when 'spTree'
          @shape_tree = ShapeTree.new(parent: self).parse(node_child)
        when 'bg'
          @background = Background.new(parent: self).parse(node_child)
        end
      end
      self
    end
492861
def parse(node)
      node.attributes.each do |key, value|
        case key
        when 'state'
          @state = value.value.to_sym
        when 'topLeftCell'
          @top_left_cell = Coordinates.parse_coordinates_from_string(value.value)
        when 'xSplit'
          @x_split = value.value
        when 'ySplit'
          @y_split = value.value
        end
      end
      self
    end
1113298
def parse(node)
      node.attributes.each do |key, value|
        case key
        when 'gridSpan'
          @grid_span = value.value.to_i
        when 'hMerge'
          @horizontal_merge = value.value.to_i
        when 'vMerge'
          @vertical_merge = value.value.to_i
        end
      end

      node.xpath('*').each do |node_child|
        case node_child.name
        when 'txBody'
          @text_body = TextBody.new(parent: self).parse(node_child)
        when 'tcPr'
          @properties = CellProperties.new(parent: self).parse(node_child)
        when 'p'
          @elements << DocumentStructure.default_table_paragraph_style.dup.parse(node_child,
                                                                                 0,
                                                                                 DocumentStructure.default_table_run_style,
                                                                                 parent: self)
        when 'sdt'
          @elements << StructuredDocumentTag.new(parent: self).parse(node_child)
        when 'tbl'
          @elements << Table.new(parent: self).parse(node_child)
        end
      end
      self
    end
1343587
def parse(node)
      node.attributes.each do |key, value|
        case key
        when 'val'
          @value = value.value.to_sym
        when 'color'
          @color = value.value.to_sym
        when 'fill'
          @fill = Color.new(parent: self).parse_hex_string(value.value.to_s)
        end
      end
      self
    end
114105
def parse(node)
      node.xpath('*').each do |node_child|
        case node_child.name
        when 'shape'
          @type = :shape
          @data = OldDocxShape.new(parent: self).parse(node_child)
        when 'group'
          @type = :group
          @data = OldDocxGroup.new(parent: self).parse(node_child)
        when 'style'
          @style_number = node_child.attribute('val').value.to_i
        end
      end
      self
    end
692049
def parse(node)
      node.attributes.each do |key, value|
        case key
        when 'dur'
          @duration = value.value
        when 'restart'
          @restart = value.value
        when 'id'
          @id = value.value
        end
      end

      node.xpath('*').each do |node_child|
        case node_child.name
        when 'stCondLst'
          @start_conditions = ConditionList.new(parent: self).parse(node_child)
        when 'endCondLst'
          @end_conditions = ConditionList.new(parent: self).parse(node_child)
        when 'childTnLst'
          @children = TimeNode.parse_list(node_child)
        end
      end
      self
    end
285171
def parse(node)
      node.attributes.each do |key, value|
        case key
        when 'type'
          @unit = value.value.to_sym
        when 'w', 'val'
          @value = value.value.to_f
        end
      end
      self
    end
1323182
def parse(node)
      node.xpath('*').each do |node_child|
        case node_child.name
        when 'accPr'
          node_child.xpath('*').each do |node_child_child|
            case node_child_child.name
            when 'chr'
              @symbol = node_child_child.attribute('val').value
            end
          end
        end
      end
      @element = DocxFormula.new(parent: self).parse(node)
      self
    end
513673
def _parse_tree(self, node):
        
        if 'type' in node.attrib:
            self.kind = node.attrib['type']
        if 'width' in node.attrib:
            self.width = int(node.attrib['width'])
        if 'height' in node.attrib:
            self.height = int(node.attrib['height'])
        self.url = node.text
217258
def parse_on_condition(self, node):
        

        try:
            test = node.lattrib['test']
        except:
            self.raise_error('<OnCondition> must specify a test.')
            
        event_handler = OnCondition(test)

        self.current_regime.add_event_handler(event_handler)

        self.current_event_handler = event_handler
        self.process_nested_tags(node)
        self.current_event_handler = None
42115
def parse(node)
      node.xpath('*').each do |node_child|
        case node_child.name
        when 'tnLst'
          @time_node_list = TimeNode.parse_list(node_child)
        end
      end
      self
    end
1114708
def parse(node)
      @font_style = root_object.default_font_style.dup
      node.attributes.each do |key, value|
        case key
        when 'sz'
          @font_size = value.value.to_f / 100.0
        when 'szCs'
          @font_size_complex = node.attribute('val').value.to_i / 2.0
        when 'spc'
          @space = OoxmlSize.new(value.value.to_f, :one_100th_point)
        when 'b'
          @font_style.bold = option_enabled?(node, 'b')
        when 'i'
          @font_style.italic = option_enabled?(node, 'i')
        when 'u'
          @font_style.underlined = Underline.new(parent: self).parse(value.value)
        when 'strike'
          @font_style.strike = value_to_symbol(value)
        when 'baseline'
          case value.value.to_i
          when -25_000, -30_000
            @baseline = :subscript
          when 30_000
            @baseline = :superscript
          when 0
            @baseline = :baseline
          end
        when 'cap'
          @caps = value.value.to_sym
        end
      end
      node.xpath('*').each do |node_child|
        case node_child.name
        when 'sz'
          @size = Size.new.parse(node_child)
        when 'shadow'
          @shadow = option_enabled?(node_child)
        when 'emboss'
          @emboss = option_enabled?(node_child)
        when 'vanish'
          @vanish = option_enabled?(node_child)
        when 'rtl'
          @rtl = option_enabled?(node_child)
        when 'spacing'
          @spacing = RunSpacing.new(parent: self).parse(node_child)
        when 'color'
          @color = OoxmlColor.new(parent: self).parse(node_child)
        when 'solidFill'
          @font_color = Color.new(parent: self).parse_color(node_child.xpath('*').first)
        when 'latin'
          @font_name = node_child.attribute('typeface').value
        when 'b'
          @font_style.bold = option_enabled?(node_child)
        when 'i'
          @font_style.italic = option_enabled?(node_child, 'i')
        when 'u'
          @font_style.underlined = Underline.new(:single)
        when 'vertAlign'
          @vertical_align = node_child.attribute('val').value.to_sym
        when 'rFont'
          @font_name = node_child.attribute('val').value
        when 'rFonts'
          @font_name = node_child.attribute('ascii').value if node_child.attribute('ascii')
        when 'strike'
          @font_style.strike = option_enabled?(node_child)
        when 'hlinkClick'
          @hyperlink = Hyperlink.new(parent: self).parse(node_child)
        when 'ln'
          @outline = Outline.new(parent: self).parse(node_child)
        when 'lang'
          @language = ValuedChild.new(:string, parent: self).parse(node_child)
        when 'position'
          @position = Position.new(parent: self).parse(node_child)
        when 'shd'
          @shade = Shade.new(parent: self).parse(node_child)
        when 'rStyle'
          @run_style = RunStyle.new(parent: self).parse(node_child)
        end
      end
      @font_color = DocxColorScheme.new(parent: self).parse(node)
      @font_name = root_object.default_font_typeface if @font_name.empty?
      @font_size ||= root_object.default_font_size
      self
    end
865753
def parse(node)
      node.xpath('*').each do |node_child|
        case node_child.name
        when 'alias'
          @alias = ValuedChild.new(:string, parent: self).parse(node_child)
        when 'tag'
          @tag = ValuedChild.new(:string, parent: self).parse(node_child)
        when 'lock'
          @lock = ValuedChild.new(:symbol, parent: self).parse(node_child)
        end
      end
      self
    end
519556
def parse(node)
      node.xpath('*').each do |node_child|
        case node_child.name
        when 'stSnd'
          @start_sound = Sound.new(parent: self).parse(node_child.xpath('p:snd').first) unless node_child.xpath('p:snd').first.nil?
        when 'endSnd'
          @end_sound = Sound.new(parent: self).parse(node_child.xpath('p:snd').first) unless node_child.xpath('p:snd').first.nil?
        end
      end
      self
    end