title: How does the document() function work in XSLT?
body: <p>so basically I have been tearing my hair out trying to get the document() function in xslt working, however I cannot find a way for my life. I have been told to learn it in Notepad++ using the XMLTools plugin and transforming the xml.</p>
  
  <p>I have created 2 basic xml files with brief data in but I am incapable of even linking these two files together as I cannot find any help online for learning this.</p>
  
  <p>My first xml named cars.xml:</p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
  &lt;!DOCTYPE cars SYSTEM "cars.dtd"&gt;
  &lt;cars&gt;
      &lt;car&gt;
          &lt;carManufacturer&gt;BMW&lt;/carManufacturer&gt;
          &lt;carModel&gt;1 Series&lt;/carModel&gt;
          &lt;carYear&gt;2013&lt;/carYear&gt;
          &lt;carPrice&gt;£7,950&lt;/carPrice&gt;
      &lt;/car&gt;
      &lt;car&gt;
          &lt;carManufacturer&gt;BMW&lt;/carManufacturer&gt;
          &lt;carModel&gt;3 Series&lt;/carModel&gt;
          &lt;carYear&gt;2014&lt;/carYear&gt;
          &lt;carPrice&gt;£9,950&lt;/carPrice&gt;
      &lt;/car&gt;
  &lt;/cars&gt;
  </code></pre>
  
  <p>And my second xml file named customers.xml:</p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
  &lt;!DOCTYPE customers SYSTEM "cars.dtd"&gt;
  &lt;customers&gt;
      &lt;customer&gt;
          &lt;firstName&gt;John&lt;/firstName&gt;
          &lt;lastName&gt;Smith&lt;/lastName&gt;
          &lt;location&gt;Carterton&lt;/location&gt;
      &lt;/customer&gt;
      &lt;customer&gt;
          &lt;firstName&gt;Jeremy&lt;/firstName&gt;
          &lt;lastName&gt;Clarkson&lt;/lastName&gt;
          &lt;location&gt;Chipping Norton&lt;/location&gt;
      &lt;/customer&gt;
  &lt;/customers&gt;
  </code></pre>
  
  <p>This is what I have come up with in my xsl soo far but I have gotten no where:</p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
  &lt;xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"&gt;
  
      &lt;xsl:output method="html" indent="no"/&gt;
      &lt;xsl:template match="/"&gt;
          &lt;xsl:call-template name="StartHTML"&gt;
              &lt;xsl:with-param name="Title" select="'Cars'"/&gt;
          &lt;/xsl:call-template&gt;
      &lt;/xsl:template&gt;
      &lt;!--&lt;xsl:template match="cars"&gt;
          &lt;xsl:variable name="CarName"&gt;
              &lt;xsl:value-of select="car/carManufacturer"/&gt;
              &lt;xsl:text&gt; &lt;/xsl:text&gt;
              &lt;xsl:value-of select="car/carModel"/&gt;
          &lt;/xsl:variable&gt;
  
      &lt;/xsl:template&gt;--&gt;
  &lt;/xsl:stylesheet&gt;
  </code></pre>
  
  <p>Any help at all using this function would be greatly appreciated :)</p>