title: xsltproc html documents
body: <p>I'm trying to clean some htmls. I have converted them to xhtml with tidy</p>
  
  <pre><code>$ tidy -asxml -i -w 150 -o o.xml index.html
  </code></pre>
  
  <p>The resulting xhtml ends up having named entities.
  When trying xsltproc on those xhtmls, I keep getting errors.</p>
  
  <pre><code>$ xsltproc --novalid  -o out.htm  t.xsl o.xml
  o.xml:873: parser error : Entity 'mdash' not defined
              resources to storing data and using permissions &amp;mdash; as needed.&lt;/
                                                                     ^
  o.xml:914: parser error : Entity 'uarr' not defined
          &lt;/div&gt;&lt;a href="index.html#top" style="float:right"&gt;&amp;uarr; Go to top&lt;/a&gt;
                                                                   ^
  o.xml:924: parser error : Entity 'nbsp' not defined
            Android 3.2&amp;nbsp;r1 - 27 Jul 2011 12:18
  </code></pre>
  
  <p>If I add --html to the xsltproc it complains on a tag that has name and id attributes with same name (which is valid)</p>
  
  <pre><code>$ xsltproc --novalid --html -o out.htm  t.xsl o.xml o.xml:845: element a: validity error : ID top already defined
        &lt;a name="top" id="top"&gt;&lt;/a&gt;
                              ^
  </code></pre>
  
  <p>The xslt is simple:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="ISO-8859-1"?&gt;
  &lt;xsl:stylesheet version="1.0"
   xmlns:xsl="http://www.w3.org/1999/XSL/Transform"&gt;
  &lt;xsl:output method="html" indent="yes" omit-xml-declaration="yes"/&gt;
  
      &lt;xsl:template match="node()|@*"&gt;
        &lt;xsl:copy&gt;
           &lt;xsl:apply-templates select="node()|@*"/&gt;
        &lt;/xsl:copy&gt;
      &lt;/xsl:template&gt;
  
      &lt;xsl:template match="//*[@id=side-nav]"/&gt;
  &lt;/xsl:stylesheet&gt;
  </code></pre>
  
  <p>Why doesn't --html work? Why is it complaining? Or should I forget it and fix the entities?</p>