April 4, 2002 - Defining A Result Table in XSL | WebReference

April 4, 2002 - Defining A Result Table in XSL

Yehuda Shiran April 4, 2002
Defining A Result Table in XSL
Tips: April 2002

Yehuda Shiran, Ph.D.
Doc JavaScript

The stock.xsl file transforms the XML quote data to HTML. We create a table with explanatory headings, and populate it with the quote information. We define the table to have a solid border, and the column headings are bold, and underlined. The Last trading data is emphasized by filling its cell with light gray. Here is the table definition in stock.xsl:

 <TABLE STYLE="border:1px solid black">
    <TR STYLE="font-size:8pt; font-family:Verdana; font-weight:bold; text-decoration:underline">
      <TD>Symbol</TD> 
      <TD STYLE="background-color:lightgrey">Last</TD> 
      <TD>Date</TD>
      <TD>Time</TD> 
      <TD>Chg</TD> 
      <TD>Open</TD> 
      <TD>High</TD>
      <TD>Low</TD>
      <TD>Vol</TD>
      <TD>MktCap</TD>
      <TD>Prev Close</TD>
      <TD>% Chg</TD>
      <TD>Ann Range</TD>
      <TD>Earns</TD>
      <TD>P-E</TD>
      <TD>Name</TD>
    </TR>
Learn more about consuming the StockQuote Web service from Column 105, Web Services, Part X: Consuming the StockQuote.