title: Extracting namespace-prefix from an XML using XSLT
body: <p>I have a SOAP XML. I need to take the XML into a variable and then I have to extract the namespace prefix from that variable using XSLT.</p>
  
  <p>For example, if my XML is,</p>
  
  <pre><code>&lt;soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:out="http://soap.sforce.com/2005/09/outbound" xmlns:urn="urn:sobject.enterprise.soap.sforce.com"&gt;
      &lt;soapenv:Header/&gt;
      &lt;soapenv:Body&gt;
          &lt;a&gt;
              &lt;s&gt;sakdjhkjh&lt;/s&gt;
              &lt;j&gt;jhgkjhkjd&lt;/j&gt;
          &lt;/a&gt;
      &lt;/soapenv:Body&gt;
  &lt;/soapenv:Envelope&gt;
  </code></pre>
  
  <p>I have to take it into a variable called input(<code>&lt;xsl:variable name="input"&gt;&lt;xsl:copy-of select="."/&gt;&lt;/xsl:variable&gt;</code>).</p>
  
  <p>Now, from this variable ($input), I have to extract the namespace prefix 'soapenv'.</p>
  
  <p>If my data is,</p>
  
  <pre><code>&lt;soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:out="http://soap.sforce.com/2005/09/outbound" xmlns:urn="urn:sobject.enterprise.soap.sforce.com"&gt;
      &lt;soap:Header/&gt;
      &lt;soap:Body&gt;
          &lt;a&gt;
              &lt;s&gt;sakdjhkjh&lt;/s&gt;
              &lt;j&gt;jhgkjhkjd&lt;/j&gt;
          &lt;/a&gt;
      &lt;/soap:Body&gt;
  &lt;/soap:Envelope&gt;
  </code></pre>
  
  <p>then I have to get soap in my XSLT output.</p>
  
  <p>Can someone help me out here.</p>
  
  <p>Thank You,</p>
  
  <p>Najma</p>