title: How to display attributes in XSLT of a specific node?
body: <p>I am trying to style XML data using an XSLT stylesheet. I have two teams in my XML file "V" and "H" for visiting and home. I want to display their stats in two separate tables. I'm just not sure how to tell the XSLT that I want only the attributes for the specific team.I'd like to be able to say xsl:value-of select="team" where the vh attribute = "V" pull out these values of ID, Name, Record, etc.<br>
  XML: </p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;?xml-stylesheet type="text/xsl" href="stylesheet.xsl"?&gt; 
  &lt;bbgame source="STAT CREW Basketball" version="4.15.03" generated="12/17/2013"&gt;
  &lt;team vh="V" id="MSU" name="MISSOURI STATE" record="8-2"&gt;
      &lt;linescore line="24,36" score="60"&gt;
        &lt;lineprd prd="1" score="24"&gt;&lt;/lineprd&gt;
        &lt;lineprd prd="2" score="36"&gt;&lt;/lineprd&gt;
      &lt;/linescore&gt;
  &lt;/team&gt;
  &lt;team vh="H" id="LOU" name="LOUISVILLE" record="10-1"&gt;
      &lt;linescore line="47,43" score="90"&gt;
        &lt;lineprd prd="1" score="47"&gt;&lt;/lineprd&gt;
        &lt;lineprd prd="2" score="43"&gt;&lt;/lineprd&gt;
      &lt;/linescore&gt;
  &lt;/team&gt;
  &lt;/bbgame&gt;
  </code></pre>
  
  <p>XSL:</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"&gt;
  
  &lt;xsl:template match="bbgame"&gt;
  &lt;html&gt;
  &lt;head&gt;
      &lt;link rel="stylesheet" type="text/css" href="stylesheet.css"/
  &lt;/head&gt;
  &lt;body&gt;
      &lt;h1&gt;Official Basketball Box Score -- Game Totals&lt;/h1&gt;
      &lt;table&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;xsl:value-of select="venue/@visname"/&gt; vs. &lt;/td&gt;
              &lt;td&gt;&lt;xsl:value-of select="venue/@homename"/&gt;&lt;/td&gt;
              &lt;td&gt;&lt;xsl:value-of select="venue/@date"/&gt;&lt;/td&gt;
              &lt;td&gt;&lt;xsl:value-of select="venue/@time"/&gt;&lt;/td&gt;
              &lt;td&gt;&lt;xsl:value-of select="venue/@location"/&gt;&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/table&gt;
  &lt;table&gt;
      &lt;tr&gt;
          &lt;td&gt;
              &lt;xsl:value-of select="team/@id"/&gt;&lt;/td&gt;
          &lt;td&gt;    &lt;xsl:value-of select="team/linescore/@score"/&gt;&lt;/td&gt;     
      &lt;/tr&gt;   
  &lt;/table&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  &lt;/xsl:template&gt;
  &lt;/xsl:stylesheet&gt; 
  </code></pre>
  
  <p>EDIT: </p>
  
  <pre><code>&lt;table&gt;
      &lt;xsl:if test="team[@vh="V"]"&gt;
      &lt;tr&gt;
          &lt;td&gt;    &lt;xsl:value-of select="team/@id"/&gt;&lt;/td&gt;
          &lt;td&gt;    &lt;xsl:value-of select="team/linescore/@score"/&gt;&lt;/td&gt;     
      &lt;/tr&gt;
      &lt;/xsl:if&gt;   
  &lt;/table&gt;
  </code></pre>