title: How do I prevent the Java XML Transformer using "HTML" method from adding <META> tag?
body: <p>I'm using the built-in Java XML Transformer to serialize an XML document into text. I'm having a problem however when I am outputting in HTML mode.</p>
  
  <p>Whenever I insert a <code>head</code> element the built-in transformer decides to insert a <code>META</code> tag with content-type data. I don't want this tag inside my data and I can't seem to find an output parameter that will disable this feature. I know I could build an xslt stylesheet and strip the tag in question, but it would be simpler just to be able to set a parameter on the transformer itself that disables it.</p>
  
  <p>You might respond with "but you really should have this tag" -- trust me, I don't need it, for brevities sake I won't go into it.</p>
  
  <p>Sample code</p>
  
  <pre><code>Document d; 
  //d = &lt;html&gt;&lt;head&gt;&lt;title&gt;&lt;/title&gt;&lt;/head&gt;&lt;body&gt;&lt;/body&gt;&lt;/html&gt;
  
  Transformer t; //properly inited with no xslt specified
  
  t.setOutputProperty(OutputKeys.METHOD,"html");
  t.setOutputProperty(OutputKeys.INDENT,"no");
  t.transform(new DOMSource(d), result);
  
  System.out.println(result);
  </code></pre>
  
  <p>returns</p>
  
  <pre><code>&lt;html&gt;&lt;head&gt;&lt;META http-equiv="Content-Type" content="text/html; charset=UTF-8"&gt;&lt;title&gt;&lt;/title&gt;&lt;style type="text/css"&gt;&lt;/style&gt;&lt;/head&gt;&lt;body&gt;&lt;/body&gt;&lt;/html&gt;
  </code></pre>
  
  <p>Case in point, I don't want that <code>META</code> tag there. How do I get rid of it in the easiest way possible?</p>
  
  <p><em>UPDATE:</em></p>
  
  <p>I've run across the option <code>{http://xml.apache.org/xalan}omit-meta-tag</code> which is supposed to do what I'm looking for. However it seems as though it's being ignored.</p>