title: javax.xml.transform.TransformerException: iframe is not allowed in this position in the stylesheet
body: <p>I put a javascript function in my xsl file. This function must be called whenever onclick event is fired.</p>
  
  <pre><code>&lt;script type= "text/javascript"&gt;
      &lt;xsl:text&gt;
          function embeddedPreview(source) {
              if($("#embed").length &gt; 0) {
              //set the source to the location asked for
                  $("#embed").attr("src", source);
              } else {
                  //Create the embed iframe
                  $("#preview-embed").append("&lt;iframe id='embed' src='"+source+"' width='100%' height='342px' style='border:none;'/&gt;");         //requires jQuery
              }
          }
      &lt;/xsl:text&gt;
  &lt;/script&gt;
  </code></pre>
  
  <p>When I run this, an error below occurs pointing to Line 9.</p>
  
  <pre><code>javax.xml.transform.TransformerException: iframe is not allowed in this position in the stylesheet!
  </code></pre>
  
  <p>Below is  a part of my xsl file where iframe must be appended, particularly in div with an id of "preview-embed".
      
          
              
              
          
      </p>
  
  <p>What does it mean? Does div is not allowed to be appended with an iframe? Please help me. </p>