Helping ordinary people create extraordinary websites!
HOME TUTORIALS SCRIPTS WEB HOSTING BLOG FORUM
Get Our Newsletter
Email:

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:
» Converting XML to HTML
» Simple substitution
» Function-based substitution
» Tree-based processing
» Active XML documents
» Storing tag contents
» Retrieving the rules
» Acting on the rules
» Next steps
» Resources


First published by IBM DeveloperWorks


 | Bookmark
Related Tutorials:
» Starting with XML
» Performing Client-Side XSL Transformations
» Create a Google Sitemap for your Web Site
» Parsing Comma-Separated Values
» XML Security Suite: Increasing the Security of E-Business
» Servlets and XML: Made for Each Other