title: XSLT- using global variable in template
body: <p>I am sure there must be something obvious I am doing wrong. (Altova XMLSpy 2012 professional sp1)</p>
  
  <p>I have declared and want to use a global variable:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:fn="http://www.w3.org/2005/xpath-functions" exclude-result-prefixes="xs fn"&gt;
      &lt;xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes" omit-xml-declaration="no" doctype-system="myDTD.dtd" /&gt;
  
      &lt;!-- Edit these parameters if necessary. --&gt;
      &lt;xsl:param name="outObject" select="POSIT"/&gt;
  
      &lt;xsl:template match="section"&gt;
          &lt;xsl:element name="section"&gt;
                  &lt;!-- debug --&gt;
              &lt;xsl:element name="para"&gt;Debug: outObject = &lt;xsl:value-of select="$outObject"/&gt;&lt;/xsl:element&gt;
          &lt;/xsl:element&gt;
      &lt;/xsl:template&gt;
  
  
  &lt;/xsl:stylesheet&gt;
  </code></pre>
  
  <p>This produces this output:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;&lt;!DOCTYPE section SYSTEM "myDTD.dtd"&gt;
  &lt;section&gt;
      &lt;title/&gt;
      &lt;para&gt;Debug: outObject = &lt;/para&gt;
  &lt;/section&gt;
  </code></pre>
  
  <p>I would have thought that I could access the value of $outObject here. What have I misunderstood?</p>