title: XML - Creating an order form
body: <p>I have a homework assignment that asks to create an order form. The order form is supposed to include a list of items available for the user to purchase, which comes from an XML document and is styled with an XSL file.</p>
  
  <p>I got through this part fine, and loaded the XSL into the HTML DOM using JavaScript. Now I'm stuck trying to figure out how I will process the data. I need to multiply the quantity (which is inputted by the user), and the price (which is inputted from the XML).</p>
  
  <p>I am completely stuck and would greatly appreciate any hints on where to go from here.</p>
  
  <p>My XSLT:</p>
  
  <pre><code>&lt;table width="0" border="1" cellspacing="3" cellpadding="5"&gt;
    &lt;tr&gt;
      &lt;td&gt;Qty&lt;/td&gt;
      &lt;td&gt;Item Description&lt;/td&gt;
      &lt;td&gt;Price&lt;/td&gt;
    &lt;/tr&gt;
   &lt;xsl:for-each select="//item"&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;input name="top" type="text" onchange="calculate()" value="0" size="4" /&gt;&lt;/td&gt;
      &lt;td&gt;Item &lt;xsl:value-of select="id"/&gt;&lt;/td&gt;
      &lt;td&gt;&lt;xsl:value-of select="price"/&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;/xsl:for-each&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>Some XML:</p>
  
  <pre><code>&lt;productcatalog&gt;
  
          &lt;item&gt;
              &lt;id&gt;001&lt;/id&gt;
              &lt;name&gt;Item #1&lt;/name&gt;
              &lt;price&gt;10&lt;/price&gt;
          &lt;/item&gt;
          &lt;item&gt;
              &lt;id&gt;002&lt;/id&gt;            
              &lt;name&gt;Item #2&lt;/name&gt;
              &lt;price&gt;20&lt;/price&gt;
          &lt;/item&gt;
          &lt;item&gt;
              &lt;id&gt;003&lt;/id&gt;
              &lt;name&gt;Item #3&lt;/name&gt;
              &lt;price&gt;30&lt;/price&gt;
          &lt;/item&gt;
          &lt;item&gt;
              &lt;id&gt;004&lt;/id&gt;
              &lt;name&gt;Item #4&lt;/name&gt;
              &lt;price&gt;40&lt;/price&gt;
          &lt;/item&gt;
  
  
  
  &lt;/productcatalog&gt;
  </code></pre>