title: How to correctly fetch data from xml using xslt when xml has namespace associated with elements
body: <p>I am trying to do some transformation using xslt, however i am facing some issues if a namespace is declared in XML file:</p>
  
  <p>Example:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
   &lt;rootNode xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:schemaLocation="http://example.com/ XSD.xsd"
     xmlns="http://example.com/"&gt;
  
    &lt;elem1&gt; TEST &lt;/elem1&gt;
  
  &lt;/rootNode&gt;
  </code></pre>
  
  <p>In the xsl stylesheet, i have code like this:</p>
  
  <pre><code>&lt;xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"&gt;
  
  &lt;xsl:output omit-xml-declaration="no" indent="yes"/&gt;
  
   &lt;xsl:template match="/"&gt;
  
       &lt;TAG1&gt;  &lt;xsl:value-of select="elem1"/&gt; &lt;/TAG1&gt;
  
   &lt;/xsl:template&gt;
  
  &lt;/xsl:stylesheet&gt;
  </code></pre>
  
  <p>The problem is that if I don't remove the namespace in XML viz:
      xmlns="http://example.com/"</p>
  
  <p>No values are getting fetched from the XML file.</p>
  
  <p>I tried searching lots posts, however i didn't get any concrete clue as to what is happening. I think, somehow it might be related to namespace, that too i tried, no values are getting fetched from the XML.</p>
  
  <p>Any help in this is greatly appreciated.</p>