title: parameterized doctype in xsl:stylesheet
body: <p>How could I inject a --stringparam (xsltproc) into the DOCTYPE of a XSL stylesheet? The --stringparam is specified from the command line.</p>
  
  <p>I have several books in docbook5 format I want to process with the same customization layer, each book having an unique identifier, here "demo", so I'm running something like</p>
  
  <blockquote>
    <p>xsltproc --stringparam course.name demo ...</p>
  </blockquote>
  
  <p>for each book.</p>
  
  <p>Obviously the parameter is not recognized as such, but as verbatim text, giving the error:</p>
  
  <blockquote>
    <p>warning: failed to load external entity "http://edu.yet-another-project.com/course/$(course.name)/entities.ent"</p>
  </blockquote>
  
  <p>Here it is how I've tried, which won't work:</p>
  
  <pre><code>&lt;?xml version='1.0'?&gt;
  &lt;!DOCTYPE stylesheet [
  &lt;!ENTITY % myent SYSTEM "http://edu.yet-another-project.com/course/$(course.name)/entities.ent"&gt;
  %myent;
  ]&gt;
  &lt;xsl:stylesheet  
      xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
          version="1.0"&gt;
  
  &lt;!-- the docbook template used --&gt;
  &lt;xsl:import href="http://docbook.org/ns/docbook/xhtml/chunk.xsl"/&gt;
  
  &lt;!-- processor parameters --&gt;
  &lt;xsl:param name="html.stylesheet"&gt;default.css&lt;/xsl:param&gt;
  &lt;xsl:param name="use.id.as.filename"&gt;1&lt;/xsl:param&gt;
  &lt;xsl:param name="chunker.output.encoding"&gt;UTF-8&lt;/xsl:param&gt;
  &lt;xsl:param name="chunker.output.indent"&gt;yes&lt;/xsl:param&gt;
  &lt;xsl:param name="navig.graphics"&gt;1&lt;/xsl:param&gt;
  &lt;xsl:param name="generate.revhistory.link"&gt;1&lt;/xsl:param&gt;
  &lt;xsl:param name="admon.graphics"&gt;1&lt;/xsl:param&gt;
  
  &lt;!-- here more stuff --&gt;
  &lt;/xsl:stylesheet&gt;
  </code></pre>
  
  <p>Ideas?</p>