Chapter 14. XML

In Chapter 12, I demonstrated the various options available to structure and style tables. In this chapter, I discuss how CSS can be combined with XML to style XML documents. This chapter covers the following:

  • What XML is

  • How to create an XML document structure suitable for presentation

  • The XML declaration

  • The CSS display property

  • Displaying block-level boxes with XML and CSS

  • Displaying inline-level boxes with XML and CSS

  • Recreating the structure, layout, and behavior of HTML tables using XML and CSS

XML is a robust and flexible markup language. Its uses extend to desktop applications such as spreadsheets and music jukebox software. It is also used heavily on the Internet for a plethora of applications. Many people see XML as the web language of tomorrow, one that will eventually replace HTML as the mainstream markup language of choice for building websites. In the following sections, you look further into XML.

Note

In this chapter I assume that you have a basic familiarity with XHTML. If you'd like to learn more about XHTML, try Beginning Web Programming with HTML, XHTML, and CSS by Jon Duckett (Wrox Press, 2004). For more information about XML, try Beginning XML, Third Edition, by David Hunter et al. (Wrox Press, 2004).

Crash Course in XML

XML documents have many uses. For example, an XML document can be used to store data (like a database) because in an XML document you invent the tags and attributes. You have the advantage of creating tags in an XML document that describe ...

Get Beginning CSS: Cascading Style Sheets for Web Design, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.