title: Why does XhtmlTextWriter ignore custom attributes?
body: <p>I've found some weird behaviour and I was wondering if anyone can help out here.</p>
  
  <p>I'm creating a form using the XhtmlTextWriter class that inherits the addAttribute methods. I'm creating an <code>input</code> tag that needs a nice (HTML5) placeholder attribute. The <code>addAttribute</code> method has two parameters: the attribute name and the value. The attribute name can either be picked from the <code>HtmlTextWriteAttribute</code> enum or inputted manually as a string. Since 'placeholder' is not available in the enum, I used the following code:</p>
  
  <pre><code>StringWriter sw = new StringWriter();
  XhtmlTextWriter html = new XhtmlTextWriter(sw);
  html.AddAttribute(HtmlTextWriterAttribute.Type, "text");
  html.AddAttribute(HtmlTextWriterAttribute.Name, "firstname");
  html.AddAttribute("placeholder", "First Name");
  html.AddAttribute("maxlength", "25");
  html.RenderBeginTag(HtmlTextWriterTag.Input);
  html.RenderEndTag();//input
  return sw.ToString();
  </code></pre>
  
  <p>This nicely creates the element &amp; attributes specified... EXCEPT for placeholder:</p>
  
  <pre><code>&lt;input type="text" name="firstname" maxlength="25"&gt;&lt;/input&gt;
  </code></pre>
  
  <p>Does anyone know where my placeholder is? (As you can see with <code>maxlength</code>, using a string for attribute name works...)</p>
  
  <p>Note: This does work, but it's not so pretty:</p>
  
  <pre><code>html.WriteBeginTag("input"); 
  html.WriteAttribute("type", "text");
  html.WriteAttribute("placeholder", "First Name");
  html.Write(HtmlTextWriter.SelfClosingTagEnd);
  </code></pre>
  
  <p>// Update: Same problem with the <code>required</code> attribute... Could it be something HTML5 specific?</p>