anchor.diff:    <% when :element %>
       <% prefix = doc.namespace.nil? ? "" : (doc.namespace.prefix || "") %>
       <% doc_name = prefix == "" ? doc.name : "#{prefix}:#{doc.name}" %>
  -    <div <%=  error_id ? "class='error'".html_safe : '' %> >
  +    <div <%=  (error_id && errors && errors.count > 0)? "class='error'".html_safe : '' %> >
       <span class="markup">&lt;</span>
       <span class="start-tag "><%= doc_name %></span>
       <% doc.namespace_definitions.each do |ns| %>
  
positive.code:   <% if doc.children.length > 0 %>
      <% if node_type(doc.node_type) == :element %>
        <span class="markup">&gt;</span></div>
        <% if error_id %>
          <% popup_title, popup_button_text, popup_content = popup_attributes(errors) %>
          <% # button to display popup with error message(s) %>
          <% btn_errors = '' %>
  
negative.code:       <% attribute = att[1] %>
        <% if attribute.name != 'error_id' %>
          <% att_prefix = attribute.namespace.nil? ? "" : (attribute.namespace.prefix || "") %>
          <% att_name = att_prefix == "" ? attribute.name : "#{att_prefix}:#{attribute.name}" %>
          <span class="attribute-name <%= error_attributes.index(attribute) ? 'attribute_error' : '' %>"> <%= att_name %></span>
          <span class="markup">=</span>
          <span class="attribute-value">"<%=attribute.value %>"</span>
        <% end %>
      <% end %>
  
    <% when :document %>
      <div>
        <span class="markup">&lt;?</span><span class="start-tag">xml</span>
  