title: Getting org.w3c.dom.DOMException: HIERARCHY_REQUEST_ERR - why?
body: <p>Full execption stack:</p>
  
  <pre><code>Exception in thread "main" org.w3c.dom.DOMException: HIERARCHY_REQUEST_ERR: Si è tentato di inserire un nodo in un punto in cui non è consentito. 
  at com.sun.org.apache.xerces.internal.dom.ParentNode.internalInsertBefore(Unknown Source)
  at com.sun.org.apache.xerces.internal.dom.ParentNode.insertBefore(Unknown Source)
  at com.sun.org.apache.xerces.internal.dom.NodeImpl.appendChild(Unknown Source)
  at awtcalc2pg.parserHTML.add_component(parserHTML.java:348)
  at awtcalc2pg.pDialog.create(pDialog.java:107)
  at awtcalc2pg.parserHTML.parse(parserHTML.java:171)
  at awtcalc2pg.parserHTML.parse(parserHTML.java:164)
  at Test.main(Test.java:67)
  </code></pre>
  
  <p>My code</p>
  
  <pre><code>TransformerFactory transformerFactory = TransformerFactory.newInstance();
      Transformer transformer;
  
      try {
          transformer = transformerFactory.newTransformer();
          transformer.setOutputProperty(OutputKeys.METHOD, "html");
          DOMSource source = new DOMSource(doc);
          StreamResult result = new StreamResult(fl);
          transformer.transform(source, result);
      } catch (TransformerException exception) {
          exception.printStackTrace();
      }
  </code></pre>
  
  <p>i have a problem when i create a tag dialog. Because dialog have any component in him.</p>
  
  <p>Test html.</p>
  
  <pre><code>&lt;div&gt;
  &lt;Dialog id="dialog"&gt;&lt;/dialog&gt;
   &lt;/div&gt;
  </code></pre>