title: XSLT on XML with namespaces not working
body: <p>I have XML that gets sent off to a third-party vendor as part of a mature feed. The XML is a bit suspect with its usage of namespaces, but I most likely cannot change it at this point since the feed is mature and not to be tinkered with.</p>
  
  <p>I am trying to set up a XSLT template to display the contents of each XML feed as an HTML table. And running into problems.</p>
  
  <p>Below is a simplified version of what I'm trying, selecting just one element. If I can get past whatever I'm missing, I can probably figure out the rest myself.</p>
  
  <p>Partial XML snippet:</p>
  
  <pre><code>&lt;nis:Jobs xmlns:nis="http://schemas.monster.com/Monster/NIS" xmlns="http://schemas.monster.com/Monster" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://schemas.monster.com/Monster http://schemas.monster.com/Current/XSD/Job.xsd http://schemas.monster.com/Monster/NIS http://schemas.monster.com/Current/Extensions/NIS/XSD/NISJob.xsd"&gt;
  
      &lt;nis:NISJob&gt;
        &lt;Job jobRefCode="13425840" jobAction="addOrUpdate" jobComplete="true"&gt;
            &lt;RecruiterReference&gt;
              &lt;UserName&gt;hj45_32179&lt;/UserName&gt;
            &lt;/RecruiterReference&gt;
            &lt;CompanyReference&gt;
              &lt;CompanyXCode&gt;xhj45_36079x&lt;/CompanyXCode&gt;
              &lt;CompanyName&gt;
                &lt;![CDATA[Clarion Hotel]]&gt;
              &lt;/CompanyName&gt;
            &lt;/CompanyReference&gt;
            &lt;Channel monsterId="1180"/&gt;
              &lt;JobInformation&gt;
                  &lt;JobTitle&gt;
                      &lt;![CDATA[Front Desk Agent, Bartender, Houseperson]]&gt;
                  &lt;/JobTitle&gt;
                  &lt;JobType monsterId="1"/&gt;
                  &lt;JobStatus monsterId="4"/&gt;
                  &lt;DisableApplyOnline&gt;true&lt;/DisableApplyOnline&gt;
                  &lt;HideCompanyInfo&gt;true&lt;/HideCompanyInfo&gt;
              &lt;/JobInformation&gt;
          &lt;/Job&gt;
          &lt;nis:AdditionalProducts/&gt;
      &lt;/nis:NISJob&gt;
  &lt;/nis:Jobs&gt;
  </code></pre>
  
  <p>XLT attempt:</p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
  
  &lt;xsl:stylesheet version="1.0"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns:nis="http://schemas.monster.com/Monster/NIS" xmlns="http://schemas.monster.com/Monster" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://schemas.monster.com/Monster http://schemas.monster.com/Current/XSD/Job.xsd http://schemas.monster.com/Monster/NIS http://schemas.monster.com/Current/Extensions/NIS/XSD/NISJob.xsd"
  &gt;
  
  &lt;xsl:template match="/"&gt;
    &lt;html&gt;
    &lt;body&gt;
      &lt;h2&gt;Ads in Feed&lt;/h2&gt;
      &lt;table border="1"&gt;
        &lt;tr bgcolor="#9acd32"&gt;
          &lt;th&gt;CompanyXCode&lt;/th&gt;
        &lt;/tr&gt;
        &lt;xsl:for-each select="nis:Jobs/nis:NISJob"&gt;
          &lt;tr&gt;
            &lt;td&gt;&lt;xsl:value-of select="Job/CompanyReference/CompanyXCode"/&gt;&lt;/td&gt;
          &lt;/tr&gt;
        &lt;/xsl:for-each&gt;
      &lt;/table&gt;
    &lt;/body&gt;
    &lt;/html&gt;
  &lt;/xsl:template&gt;
  
  &lt;/xsl:stylesheet&gt;
  </code></pre>
  
  <p>I have tried this in PHP using the XSLTProcessor, and I've also tried it in W3Schools' Tryit Editor ( <a href="http://www.w3schools.com/xsl/tryxslt.asp?xmlfile=cdcatalog&amp;xsltfile=cdcatalog_ex2" rel="nofollow">http://www.w3schools.com/xsl/tryxslt.asp?xmlfile=cdcatalog&amp;xsltfile=cdcatalog_ex2</a> ) with no luck.</p>
  
  <p>I'm guessing that there's a problem with the uneven namespace usage in the XML. Any hopes of working around that that anyone knows of?</p>
  
  <p>Thanks in advance!</p>