title: How to copy external CSS and JavaScript in XSLT
body: <p>I have an XSL transformation which outputs HTML. In the <code>head</code> element I have a CSS file reference.</p>
  
  <pre><code>&lt;link rel="stylesheet" type="text/css" href="css/styles.css"/&gt;
  </code></pre>
  
  <p>I would like to create a standalone HTML result without external references and thus I would like to include external CSS references. To prevent code duplication, I do not want to hard code the styles into the XSLT template, so I am looking for some XSLT command to copy the file contents of the CSS file. I know <code>xsl:include</code> or <code>xsl:import</code> won't work, since they expect XSLT files. Neither does </p>
  
  <pre><code>&lt;xsl:copy-of select="document('css/styles.css')"/&gt;
  </code></pre>
  
  <p>as it expects something XML compliant.</p>
  
  <p>I also have some JavaScript function declarations which I would like to copy as well.</p>
  
  <p>Is this possible with pure XSLT, or will I have to do some pre-processing of the XSLT file (or post-processing of the HTML file)?</p>