title: How do I pretty-print or indent HTML using XSLT while preserving script tags?
body: <p>I'm using the following with XSLT to indent my HTML using Nokogiri:</p>
  
  <pre><code>&lt;div&gt;
    Blah
  &lt;/div&gt;
  &lt;script type="text/javascript"&gt;
    alert("hello");
  &lt;/script&gt;
  </code></pre>
  
  <p>With this Ruby code:</p>
  
  <pre><code>  doc = ::Nokogiri::XML.parse(html)
    xsl = ::Nokogiri::XSLT(File.read('pretty_print.xsl'))
    new_html = xsl.apply_to(doc).to_s
  </code></pre>
  
  <p>pretty_print.xsl:</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:strip-space elements="*" /&gt;
    &lt;xsl:output omit-xml-declaration="yes" method="xml" indent="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:stylesheet&gt;
  </code></pre>
  
  <p>I'm not familiar with XSLT. Is there a simple way to ensure script tags are not dropped?</p>