title: How to convert XML to XSL
body: <p>I am trying to convert a xml file to xslt</p>
  
  <p>My xml file is like this,</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;?xml-stylesheet type="text/xsl" href="testxsl.xsl"?&gt;
  &lt;doc&gt;
  &lt;test&gt;
      &lt;field name="id"&gt;c8b102&lt;/field&gt;
      &lt;field name="created_at"&gt;2013-11-14T00:00:00Z&lt;/field&gt;
      &lt;field name="userid"&gt;userfirst&lt;/field&gt;
      &lt;field name="screenname"&gt;userfirst&lt;/field&gt;
      &lt;field name="status"&gt;open&lt;/field&gt;
      &lt;field name="contents"&gt;testing content&lt;/field&gt;
      &lt;field name="sentiment"&gt;positive&lt;/field&gt;
      &lt;field name="location"&gt;placename&lt;/field&gt;
      &lt;field name="source"&gt;local&lt;/field&gt;
      &lt;field name="url"&gt;test&lt;/field&gt;
      &lt;field name="keyword"&gt;test&lt;/field&gt;
  &lt;/test&gt;
  &lt;test&gt;
      &lt;field name="id"&gt;c8b102&lt;/field&gt;
      &lt;field name="created_at"&gt;2013-11-14T00:00:00Z&lt;/field&gt;
      &lt;field name="userid"&gt;usersec&lt;/field&gt;
      &lt;field name="screenname"&gt;usersec&lt;/field&gt;
      &lt;field name="status"&gt;close&lt;/field&gt;
      &lt;field name="contents"&gt;test sec&lt;/field&gt;
      &lt;field name="sentiment"&gt;positive&lt;/field&gt;
      &lt;field name="location"&gt;place&lt;/field&gt;
      &lt;field name="source"&gt;local&lt;/field&gt;
      &lt;field name="url"&gt;test&lt;/field&gt;
      &lt;field name="keyword"&gt;test&lt;/field&gt;
    &lt;/test&gt;
    &lt;/doc&gt;
  </code></pre>
  
  <p>I have written a xsl code(testxsl.xsl) for transformation</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="ISO-8859-1"?&gt;
  &lt;xsl:stylesheet version="1.0"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"&gt;
  &lt;xsl:template match="/"&gt;
  &lt;html&gt;
  &lt;body&gt;
  &lt;h2&gt;Complaints&lt;/h2&gt;
  &lt;table border="1"&gt;
  &lt;tr bgcolor="#9acd32"&gt;
    &lt;th&gt;Created Date&lt;/th&gt;
    &lt;th&gt;UserID&lt;/th&gt;
    &lt;th&gt;Screenname&lt;/th&gt;
    &lt;th&gt;Status&lt;/th&gt;
    &lt;th&gt;Contents&lt;/th&gt;
    &lt;th&gt;Source&lt;/th&gt;
    &lt;th&gt;URL&lt;/th&gt;
  &lt;/tr&gt;
  &lt;xsl:for-each select="doc/test"&gt;
  &lt;tr&gt;
    &lt;td&gt;
    &lt;xsl:value-of select="date" /&gt;
    &lt;/td&gt;
    &lt;td&gt;
    &lt;xsl:value-of select="str[@name = 'userid']" /&gt;
    &lt;/td&gt;
    &lt;td&gt;
    &lt;xsl:value-of select="str[@name='screenname']" /&gt;
    &lt;/td&gt;
    &lt;td&gt;
    &lt;xsl:value-of select="str[@name='status']" /&gt;
    &lt;/td&gt;
    &lt;td&gt;
    &lt;xsl:value-of select="str[@name='contents']" /&gt;
    &lt;/td&gt;
    &lt;td&gt;
    &lt;xsl:value-of select="str[@name='source']" /&gt;
    &lt;/td&gt;
    &lt;td&gt;
    &lt;xsl:value-of select="str[@name='url']" /&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>But i am getting only header part in the output with borders and all like below,</p>
  
  <pre><code>Created Date  UserID    Screenname  Status  Contents    Source  URL
  </code></pre>
  
  <p>I dont know what is the problem, my xsl file seems to be correct</p>