title: Put double quotes around a value in XSLT
body: <p>I have an XSLT template which is outputting address data as CSV. I want to wrap some of the values in double quotes because they contain commas as part of the address data.</p>
  
  <p>My problem is that after the transform, the double quotes are missing. I can get the processor to insert almost anything, but not the double quotes I want.</p>
  
  <p>Here is some sample code:</p>
  
  <pre><code>&lt;xsl:value-of select="./*/*/LotNumber"/&gt;
  &lt;xsl:value-of select="$delim"/&gt;
  &lt;xsl:value-of select="./*/*/StreetName"/&gt;
  &lt;xsl:value-of select="$delim"/&gt;
  &lt;xsl:value-of select="./*/*/StreetType"/&gt;
  </code></pre>
  
  <p>I've previously defined $delim as:</p>
  
  <pre><code>&lt;xsl:param name="delim" select="','" /&gt;
  </code></pre>
  
  <p>So this piece of template will output for example:</p>
  
  <pre><code>10,SMITH,ST
  </code></pre>
  
  <p>Let's say for arguments sake I want to wrap the street name in double quotes, so that it comes out as:</p>
  
  <pre><code>10,"SMITH",ST
  </code></pre>
  
  <p>I've tried a variety of things, but they're all variations on the theme of declaring a double quote as:</p>
  
  <pre><code>&lt;xsl:param name="quote"&gt;"&lt;/xsl:param&gt;
  </code></pre>
  
  <p>And then wrapping my value as:</p>
  
  <pre><code>&lt;xsl:value-of select="$quote"/&gt;
  &lt;xsl:value-of select="./*/*/StreetName"/&gt;
  &lt;xsl:value-of select="$quote"/&gt;
  </code></pre>
  
  <p>But when the transformation runs, I get nothing. It just looks as it did before. Other things I've tried are:</p>
  
  <ul>
  <li>Putting the double quotes in the template as literals. Totally screws things up.</li>
  <li>Using &quot; instead of ". No effect, and I'm outputting as text not html anyway.</li>
  <li>Using and selecting a variable.</li>
  </ul>
  
  <p>Any suggestions?</p>