def view(node, slice, &block)
      slice = slice.to_i
      case node
      when ::HTML::Tag then
        children_view = node.children.map {|child| view(child, slice, &block)}.compact.join
        if resized?
          resizing.resize_node(node)
        end
        if sliced?
          if slicing.map.get(node, slice) || children_view.present?
            if node.closing == :close
              "</#{node.name}>"
            else
              s = "<#{node.name}"
              node.attributes.each do |k,v|
                s << " #{k}"
                s << "=\"#{v}\"" if String === v
              end
              s << " /" if node.closing == :self
              s << ">"
              s += children_view
              s << "</#{node.name}>" if node.closing != :self && !node.children.empty?
              s
            end
          end
        else
          node.to_s
        end
      when ::HTML::Text then
        if sliced?
          if range = slicing.map.get(node, slice)
            (range.is_a?(Array) ? node.content[Range.new(*range)] : node.content).tap do |export|
              unless range == true || (range.is_a?(Array) && range.last == -1) # broken text
                export << slicing.options.text_break if slicing.options.text_break
                if block_given?
                  yield self, export
                end
              end
            end
          end
        else
          node.to_s
        end
      when ::HTML::CDATA then
        node.to_s
      when ::HTML::Node then
        node.children.map {|child| view(child, slice, &block)}.compact.join
      end
    end
def view(node, slice, &block)
      slice = slice.to_i
      case node
      when ::HTML::Tag then
        children_view = node.children.map {|child| view(child, slice, &block)}.compact.join
        if resized?
          resizing.resize_node(node)
        end
        if sliced?
          if slicing.map.get(node, slice) || children_view.present?
            if node.closing == :close
              "</#{node.name}>"
            else
              s = "<#{node.name}"
              node.attributes.each do |k,v|
                s << " #{k}"
                s << "=\"#{v}\"" if String === v
              end
              s << " /" if node.closing == :self
              s << ">"
              s += children_view
              s << "</#{node.name}>" if node.closing != :self && !node.children.empty?
              s
            end
          end
        else
          node.to_s
        end
      when ::HTML::Text then
        if sliced?
          if range = slicing.map.get(node, slice)
            (range.is_a?(Array) ? node.content[Range.new(*range)] : node.content).tap do |export|
              unless range == true || (range.is_a?(Array) && range.last == -1) # broken text
                export << slicing.options.text_break if slicing.options.text_break
                if block_given?
                  yield self, export
                end
              end
            end
          end
        else
          node.to_s
        end
      when ::HTML::CDATA then
        node.to_s
      when ::HTML::Node then
        node.children.map {|child| view(child, slice, &block)}.compact.join
      end
    end
Return a textual representation of the node including all children.