title: Create server root relative image path in Asp.Net MVC 3 with XSLT?
body: <p>I'm trying to create image paths (in the src attribute) that are relative to the application root through XSLT.</p>
  
  <p>I want this in the src attribute: </p>
  
  <pre><code>&lt;img src="@Url.Content("~/Content/images/image.svg")" /&gt;
  </code></pre>
  
  <p>And if I insert this manually into the View files, it works fine. But I need to create the files by XSLT, since there are hundreds of them, created from XML. However, the XSLT will not let me insert the quotation marks, it escapes them with #34;</p>
  
  <p>So is there any way to do this? How can I refer to the application root without this, and automatically get this path in XSLT?</p>
  
  <p>I cannot use relative paths either, because due to the structure of the content, one controller action needs to be able to serve lots of different views found in a specific folder structure, based on id...</p>
  
  <p>EDIT:</p>
  
  <p>Actually, now I just tried </p>
  
  <pre><code>&lt;img src="/Content/images/image.svg" /&gt;
  </code></pre>
  
  <p>and that worked fine! If I inspected the image path in the browser, it does get the application root concatenated with the string in the src... So how come everyone seems to be recommending you use @Url.Content()?</p>
  
  <p>EDIT: </p>
  
  <p>To clarify, the problem is getting this into an attribute in XSLT, with nested quotes. I assume this will be impossible, because it is not allowed in XML, but I need a workaround if anyone can think of it.</p>