title: XML dataset transformation
body: <p>Hi I am new to XSLT i want to transform the Xml Dataset  where student name is mapped from a xml where there is a dataset of student name and roll no. classwise.</p>
  
  <p>I want to use a xslt but i dont want to add all the tags just the column name tag which is to be mapped and rest other columns as it is.</p>
  
  <p>here is the input and output dataset example.
  The xml is normal dataset.writexml from c# code.</p>
  
  <p>Table1:</p>
  
  <pre><code>RollNo    Sub1  Sub2 Sub3 Sub4
  1         65    89   67   34
  2         67    86   67   76
  3         86    67   78   45
  4         56    56   87   56
  5         76    56   56   78
  </code></pre>
  
  <p>Table2</p>
  
  <pre><code>Name      Sub1  Sub2 Sub3 Sub4
  Aman      65    89   67   34
  Ankit     67    86   67   76
  Om        86    67   78   45
  Narendra  56    56   87   56
  Faisal    76    56   56   78
  </code></pre>
  
  <p>This is the Xml to be used for transformation </p>
  
  <p><strong>Mapping XML</strong></p>
  
  <pre><code>&lt;?xml version="1.0" standalone="yes"?&gt;
  &lt;School&gt;
      &lt;Class Name="Class1"&gt;
          &lt;StudentData Name="Aman" RollNo="1"  /&gt;   
          &lt;StudentData Name="Ankit" RollNo="2"  /&gt;   
          &lt;StudentData Name="Om" RollNo="3"  /&gt;   
          &lt;StudentData Name="Narendra" RollNo="4"  /&gt;   
          &lt;StudentData Name="Faisal" RollNo="5"  /&gt;    
      &lt;/Class&gt;
      &lt;Class Name="Class2"&gt;
          &lt;StudentData Name="Abhinav" RollNo="1"  /&gt;   
          &lt;StudentData Name="Abhishek" RollNo="2"  /&gt;   
          &lt;StudentData Name="Ishaan" RollNo="3"  /&gt;   
          &lt;StudentData Name="Mayank" RollNo="4"  /&gt;   
          &lt;StudentData Name="Bhavana" RollNo="5"  /&gt;    
      &lt;/Class&gt;
  &lt;/School&gt;
  </code></pre>
  
  <p>XSLT created so far</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  
  &lt;xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs="http://www.w3.org/2001/XMLSchema" exclude-result-prefixes="xs"
               xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:user="http://www.contoso.com"&gt;
    &lt;xsl:output method="xml" encoding="UTF-8" indent="yes" omit-xml-declaration="yes"/&gt;
  
    &lt;xsl:template match="/"&gt;
      &lt;DocumentElement&gt;
        &lt;xsl:for-each select="//Comparision"&gt;
          &lt;xsl:if test ="number(COL7)"&gt;
        &lt;PositionMaster&gt;
  
                      &lt;xsl:variable name="RollNo" select="normalize-space(COL1)"/&gt;
                      &lt;xsl:variable name="Name"&gt;
                          &lt;xsl:value-of select="document('../../../MappingFiles/Mapping.xml')/School/PB[@Name='Class1']/TagData[@RollNo=$RollNo]/@Name"/&gt;
                      &lt;/xsl:variable&gt;
                      &lt;Name&gt;
                          &lt;xsl:choose&gt;
                              &lt;xsl:when test="$Name!=''"&gt;
                                  &lt;xsl:value-of select="$Name"/&gt;
                              &lt;/xsl:when&gt;
                              &lt;xsl:otherwise&gt;
                                  &lt;xsl:value-of select="$Name"/&gt;
                              &lt;/xsl:otherwise&gt;
                          &lt;/xsl:choose&gt;
                      &lt;/Name&gt;
            &lt;/PositionMaster&gt;
          &lt;/xsl:if &gt;
        &lt;/xsl:for-each&gt;
      &lt;/DocumentElement&gt;
    &lt;/xsl:template&gt;
  &lt;/xsl:stylesheet&gt;
  </code></pre>
  
  <p>Thanks
  Aman</p>