title: XSLT - What does "/." do?
body: <p>I am new to XSLT, so this question may be a bit silly. Could someone please explain to me what's going on here?</p>
  
  <p>I have a simple XML document (just for testing purposes) and its stylesheet.</p>
  
  <p>I don't understand why <code>&lt;xsl:value-of select="/."&gt;</code> processes all following nodes. I tested the "/." expression in XPath and it only selects the node named <code>child</code>.</p>
  
  <p>Also, if I replace the <code>/.</code> with <code>.</code> it gives the expected result (outputs only the value of node named <code>child</code>).</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="ISO-8859-1"?&gt;
  &lt;?xml-stylesheet type="text/xsl" href="style.xsl"?&gt;
  &lt;catalog title= "Catalog"&gt;
    catalog
    &lt;cd price = "10"&gt;
      &lt;title&gt; 
        title text 
        &lt;child&gt;child&lt;/child&gt;
      &lt;/title&gt;
      &lt;artist&gt;Bob Dylan&lt;/artist&gt;
      &lt;country&gt;USA&lt;/country&gt;
      &lt;company&gt;Columbia&lt;/company&gt;
      &lt;year&gt;1985&lt;/year&gt;
    &lt;/cd&gt;
    &lt;cd price = "11"&gt;
      &lt;title&gt;
        second title text
        &lt;child&gt;second child &lt;/child&gt;
      &lt;/title&gt;
      &lt;artist&gt;Bob Dylan2&lt;/artist&gt;
      &lt;country&gt;USA2&lt;/country&gt;
      &lt;company&gt;Columbia2&lt;/company&gt;
    &lt;/cd&gt;
  &lt;/catalog&gt;
  </code></pre>
  
  <p>The stylesheet:</p>
  
  <pre><code>&lt;xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"&gt;
    &lt;xsl:output method="html" media-type="text/html"/&gt;
  
    &lt;xsl:template match="/"&gt;
      &lt;html&gt;
        &lt;head&gt;     
          &lt;title&gt; &lt;xsl:value-of select="/catalog/@title" /&gt; &lt;/title&gt;     
        &lt;/head&gt;
        &lt;body&gt; 
          &lt;xsl:apply-templates select="/catalog/cd/title"/&gt;
        &lt;/body&gt;
      &lt;/html&gt;
    &lt;/xsl:template&gt;
  
    &lt;xsl:template match="child"&gt;
      &lt;b&gt;
        &lt;xsl:value-of select="/."&gt;
        &lt;/xsl:value-of&gt;
      &lt;/b&gt;
      &lt;br/&gt;
    &lt;/xsl:template&gt;
  &lt;/xsl:stylesheet&gt;
  </code></pre>
  
  <p>And the result:</p>
  
  <pre><code>title text catalog title text child Bob Dylan USA Columbia 1985 second title text second child Bob Dylan2 USA2 Columbia2
  second title text catalog title text child Bob Dylan USA Columbia 1985 second title text second child Bob Dylan2 USA2 Columbia2
  </code></pre>