XML Project
Site Map
Project Summary
Separating purchase order information from the database
- Imagine that you sell textbooks from your Web site and need an online
purchase order form to order books from your supplier. Your first step
is to separate the information that your supplier requires from your
proprietary information (stored in a well-formed XML database file)
in your Web site database. This data includes such items as book titles,
isbn numbers, and shipping details and is located in the database.xml
file.
- You then need to transform this information from the database by
creating an XSL (Extensible Style sheet Language) style sheet (purchase_order.xsl),
thus transforming the purchase order data into the purchase_order.xml
file.
- These steps establish a base from which you can create a purchase
order form.
Creating a Purchase Order form
- To structure the data contained in your purchase order form so that
your supplier can understand it, you create an XML Schema file (purchase_order.xsd)
that defines how each element, attribute, and data type is to be used.
- Against the schema, you develop an XSL file (purchase_order.xsl)
to transform the data in your XML file into an HTML document.
- You use a cascading style sheet (purchase_order.css) to format the
HTML file into an extranet web page.
Creating the Shopping Cart and Textbook pages
- Using the XML database file (database.xml),
you develop two web pages, one to display the book titles you intend
to sell — a Textbook page, and the other to consolidate the orders
— a Shopping Cart page.
- To define the content for your Shopping Cart and Textbook pages, you
design two different XML Schema, each with its own elements, attributes,
and data types.
- To transform the XML database into web pages, you create two different
XSL style sheets to define the layout and content of the outputted
documents (HTML).
- You also use CSS style sheets to format the resulting HTML documents.
- The beauty of this setup is that you have only one database to update
for each of these pages.
top
|