title: Fixing HTML attribute values with double quotes in them
body: <p>I have a set of HTML files with illegal syntax in the <code>href</code> attribute of <code>&lt;a&gt;</code> tags. For example,</p>
  
  <pre><code>&lt;a name="Conductor, "neutral""&gt;&lt;/a&gt;
  </code></pre>
  
  <p>or </p>
  
  <pre><code>&lt;meta name="keywords" content="Conductor, "hot",Conductor, "neutral",Hot wire,Neutral wire,Double insulation,Conductor, "ground",Ground fault,GFCI,Ground Fault Current Interrupter,Ground fault,GFCI,Ground Fault Current Interrupter,Arc fault circuit interrupter,Arc fault breaker,AFCI," /&gt;
  </code></pre>
  
  <p>or</p>
  
  <pre><code>&lt;b&gt;Table of Contents:&lt;/b&gt;&lt;ul class="xoxo"&gt;&lt;li&gt;&lt;a href="1.html" title="Page 1: What are "series" and "parallel" circuits?"&gt;What are "series" and "parallel" circuits?&lt;/a&gt;
  </code></pre>
  
  <p>I'm trying to process the files with Perl's <code>XML::Twig</code> module using <code>parsefile_html($file_name)</code>. When it reads a file that has this syntax, it gives this error:</p>
  
  <pre><code>x has an invalid attribute name 'y""' at C:/strawberry/perl/site/lib/XML/Twig.pm line 893
  </code></pre>
  
  <p>What I need is either a way to make the module accept the bad syntax and deal with it, or a regular expression to find and replace double quotes in attributes with single quotes.</p>