Helping ordinary people create extraordinary websites!

XML and Scripting Languages

By Parand Tony Darugar
2005-05-18

Converting XML to HTML
For the purposes of this article, we will use a stock quote, expressed as XML, as our input file:


<stock_quote>
<symbol>IBM</symbol>
<when>
<date>12/16/1999</date>
<time>4:40PM</time>
</when>
<price type="ask" value="109.1875"/>
<price type="open" value="108"/>
<price type="dayhigh" value="109.6875"/>
<price type="daylow" value="105.75"/>
<change>+2.1875</change>
<volume>7050200</volume>
</stock_quote>

This simple encoding captures information typically found in a stock quote. The formatting demonstrates certain XML features, such as attributes and empty tags. The actual XML file used in this article contains several stock_quote elements, to form a portfolio of stocks.

This XML file was created using a script to convert the Spreadsheet Format stock quotes provided by the finance.yahoo.com Web site into XML.





Tutorial pages:

First published by IBM DeveloperWorks


 2 Votes

You might also want to check these out:


Leave a Comment on "XML and Scripting Languages"
You must be logged in to post a comment.

Link to This Tutorial Page!


GET OUR NEWSLETTERS