XML is a better way of describing web content.
The following paragraphs describe briefly some projects
that show how XML is typically used. To learn more about
XML and how it is used...
Project 1
You can design an XML database to
work with a variety of output files. For example, this project
demonstrates how to develop a database containing textbook
data and vendor information and to link the database to
an extranet purchase order page for ordering from a book
supplier.
This project also shows how to retrieve information from
the same XML database and to connect it to your website
for display. You will see two completely different templates—
a Textbook page and a Shopping Cart page — that can
be filled dynamically with information from the same XML
database. You will also see an XSL stylesheet used to transform
the database information into the structure of the Web pages
and an XML Schema file used to define how each element,
attribute, and data type is used.
Click the Project
1 button to view the files that comprise this
project. This page opens in its own browser.
- Note: Internet Explorer 5+ and Netscape Mozilla are
required to display XML in a browser. Older browsers,
particularly the Netscape 4.x series cannot display XML.
Project
2
This project shows how you can use
the Extensible Stylesheet Language (XSL) to transform data
stored in an XML document into an HTML file. Using an XSL
stylesheet, you can apply certain formatting rules, called
XPath commands, that address the sections of the XML documents
that contain the information you need.
- The first set of files begins with the bridges.xml file.
It contains data about some of the world's most famous
bridges, starting with London's Tower Bridge. The bridges_out.xsl
file transforms the data over to the bridges_out.html
file:
bridges.xml
+ bridges_out.xsl
--> bridges_out.html
The second set of files starts with the same XML file,
bridges.xml, but the transformation file contains
an additional line of code that sorts the bridge names
and all pertinent data, so that Kobe's Akashi Kaikyo bridge
now heads the list.
bridges.xml
+ bridges_sort.xsl
-->
bridges_sort.html
Project
3
Until browser support for XML transformations
improves, XSLT + CSS offer web designers the most reliable
approach to developing well-formed, attractive web pages.
This project demonstrates how an XML file can be transformed
from database entries to an XHTML web page through the use
of cascading style sheets.
-
top
|