title: Stream a blob image through a XML / XSLT process
body: <p>I am trying to display an image from database with a XML / XSLT technology in a C# ASP.NET project. Here's a code sample showing how I use XSLT.</p>
  
  <pre><code>/// &lt;summary&gt;
  /// Get HTML form xml 
  /// &lt;/summary&gt;
  /// &lt;param name="xsltPath"&gt;the path to the xsl stylesheet&lt;/param&gt;
  /// &lt;param name="xml"&gt;contain the xml&lt;/param&gt;
  /// &lt;returns&gt;the html&lt;/returns&gt;
  public string GetHtmlFrom_XML_XSL(string xsltPath, string xml) 
  {
      xml = this.CleanString(xml);
      MemoryStream stream = new MemoryStream(ASCIIEncoding.UTF8.GetBytes(xml));
      XPathDocument document = new XPathDocument(stream);
      StringWriter writer = new StringWriter();
      XslCompiledTransform transform = new XslCompiledTransform();
      transform.Load(xsltPath);
      transform.Transform(document, null, writer);
      return writer.ToString();
  }
  </code></pre>
  
  <p>I now have to display an image from a blob in a SQL server... I have no clue how to do that. I tried to use a .ashx handler within the xsl sheet like that : </p>
  
  <pre><code>    &lt;img height="150" width="120"&gt;
        &lt;xsl:attribute name="src"&gt;~/ImageHandler.ashx?atoContactId=&lt;xsl:value-of select="owner/picture" /&gt;&lt;/xsl:attribute&gt;
        &lt;xsl:attribute name="alt"&gt;
          &lt;xsl:value-of select="owner/name" /&gt;
        &lt;/xsl:attribute&gt;
      &lt;/img&gt;
  </code></pre>
  
  <p>But of course, the html produced by the XSLT is streamed in the browser, and the request HTTP of the src attribute is not processed. That's resulting an empty image (red cross).</p>
  
  <p>Is there any way of working or i should forget XML / XSLT for the displaying of a blob image ?</p>