HTML and CSS Reference
In-Depth Information
Overview
As you read through this chapter, you will learn how to create well-formed and
valid XML documents (creating an XML Schema Definition), format and display XML
documents using an XSL style sheet, display an XML document in a Web page table, and
search for restaurant supply products using JavaScript by performing these general tasks:
Create an XML Schema Definition (XSD) file.•
Create an XSL style sheet to format the output of an XML document.
Bind an XSL style sheet to an XML document.
Bind an XML document to an HTML document as a data island, and display
XML data in an HTML table.
Create a JavaScript function to search for items in an XML document data island.
Plan
Ahead
General Project Guidelines
When creating an XML document, you should follow these general guidelines:
1. Determine what type of XML document you are going to create. An XML document
should follow the form of the desired output. If you are creating a text document, like
a memo or a database of inventory items, the XML document should conform to the
general form of that type of document.
2. Determine the contents of the document. The contents may be created from an existing
document or database. Many applications can create XML documents automatically, or
the XML document may have to be created manually. In either case, the type of data
must be defined with an XML Schema Definition file.
3. Determine how the document will be displayed. If the document will be displayed on a
Web page, you must think about how to format its contents for display. For example, the
document may be formatted with an XSL style sheet or displayed using an HTML table.
When necessary, more specific details concerning the above guidelines are presented at
appropriate points in the chapter. The chapter will also identify the actions performed and
decisions made regarding these guidelines during the creation of the Web pages shown in
Figure 12-1 on the previous page.
XML vs. HTML5
The first Web pages developed with HTML presented static information and allowed
linking to other Web pages with additional information. In early Web development,
data was converted into forms used in HTML documents. If the data changed, the Web
documents had to be changed. As the need arose for more dynamic Web pages that
would present current data and allow users to interact with that data, Web developers
began relying on various database management systems (DBMSs) to store and retrieve
data. Some popular DBMS systems include Oracle, Microsoft SQL Server, MySQL,
ObjectStore, and PostgreSQL. Each DBMS uses various programming language
interfaces within HTML documents to access data.
Formatting that data in an HTML document, however, could be problematic.
Data could be in the format of simple text, a table of rows and columns, or a hierarchical
structure with complex relationships. It could be in the form of tables, e-mails, and
reports. The Extensible Markup Language ( XML ) was developed to provide a way to
share all various types of data in one clear and efficient method. XML provides a common
format for all types of data that can be used by anyone using software that can read XML,
 
Search WWH ::




Custom Search