title: XSL Namespace Misunderstanding
body: <p>I am just dipping my toes into XML and XSL, and (from what I have read, unsurprisingly) I am having issues with name-space.</p>
  
  <p>I have been given some XML, and I am trying to write some XSL, however I am having issues accessing some of the namespaces and attributes etc...</p>
  
  <p>Here is an extract from the XML I have been given...</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LandXML xmlns="http://www.landxml.org/schema/LandXML-1.2" 
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
           xsi:schemaLocation="
             http://www.landxml.org/schema/LandXML-1.2 
             http://www.landxml.org/schema/LandXML-1.2/LandXML-1.2.xsd" 
           version="1.2" 
           date="2013-06-24" 
           time="01:35:45" 
           readOnly="false" 
           language="English"&gt;
    &lt;Units&gt;
      &lt;Metric linearUnit="meter" areaUnit="squareMeter" 
              volumeUnit="cubicMeter" 
              angularUnit="decimal dd.mm.ss" 
              latLongAngularUnit="decimal degrees" 
              temperatureUnit="celsius" 
              pressureUnit="milliBars"/&gt;
    &lt;/Units&gt;
    &lt;CoordinateSystem name="HATCH-121204" 
      horizontalDatum="Local" 
      verticalDatum="Local" 
      ellipsoidName="Australian National" 
      projectedCoordinateSystemName="UTM55" 
      fileLocation=""&gt;
    &lt;/CoordinateSystem&gt;
    &lt;Application name="LandXML Export" 
      manufacturer="Leica Geosystems AG" 
      version="4.3" 
      manufacturerURL="www.leica-geosystems.com"&gt;
      &lt;Author company="Leica Geosystems AG" 
        companyURL="www.leica-geosystems.com" 
        timeStamp="2013-06-24T01:35:45"/&gt;
    &lt;/Application&gt;
    &lt;CgPoints&gt;
      &lt;CgPoint name="GPS0093" 
               oID="GPS0093" 
               code="728" 
               desc="Tel 
               lines u/g" 
               role="measured" 
               latitude="-21.968945617359" longitude="148.007359609463" 
               ellipsoidHeight="288.420425" 
               timeStamp="2013-06-22T01:55:26"
      &gt;7570087.642555 603892.199974 234.579968&lt;/CgPoint&gt;
  ...
  ...
  ...
  </code></pre>
  
  <p>I am trying to access: LandXML/CgPoint/CgPoints, here is the XSL that I have written:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;!-- DWXMLSource="130622RLA.xml" --&gt;
  
  &lt;xsl:stylesheet version="2.0" 
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
    xmlns="http://xml.hexagon.com/schema/HeXML-1.5"&gt;
    &lt;xsl:template match="/"&gt;
      &lt;html&gt;
        &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/&gt;
        &lt;head&gt;
          &lt;title&gt;Field Report&lt;/title&gt;
          &lt;link rel="stylesheet" type="text/css" href="books2_xslt.css"/&gt;
          &lt;p class="header"&gt;Field Report&lt;/p&gt;
        &lt;/head&gt;
        &lt;body&gt;
          &lt;xsl:apply-templates select="CgPoints/CgPoint"/&gt;
        &lt;/body&gt;
      &lt;/html&gt;
    &lt;/xsl:template&gt;
  
    &lt;xsl:template match="CgPoint"&gt;        
      In CgPoints
      &lt;xsl:for-each select="@name"&gt;
        &lt;xsl:value-of select="."/&gt;
          HELLO CgPoint
        &lt;/xsl:for-each&gt;   
    &lt;/xsl:template&gt;
  
  &lt;/xsl:stylesheet&gt;
  </code></pre>
  
  <p>For some reason I never get into the "CgPoint" template (I never get the "In CgPoints" html output). I have tried all sorts of combinations of "LandXML/CgPoints/CgPoint",  "CgPoints/CgPoint" etc in the call and the template definition.</p>
  
  <p>Does anyone have any insight into where my misunderstanding stems from?</p>
  
  <p>Thanks in advance,</p>
  
  <p>Lee</p>