Sams Teach Yourself XML in 21 Days
-
Table of Contents
- About the Author
- Acknowledgments
- We Want to Hear from You!
- Introduction
- Part I: At a Glance
- Day 1. Welcome to XML
- Day 2. Creating XML Documents
- Day 3. Creating Well-Formed XML Documents
- Day 4. Creating Valid XML Documents: DTDs
- Declaring Attributes in DTDs
- Day 6. Creating Valid XML Documents: XML Schemas
- Day 7. Creating Types in XML Schemas
- Part I. In Review
- Day 8. Formatting XML by Using Cascading Style Sheets
- Day 9. Formatting XML by Using XSLT
- Day 10. Working with XSL Formatting Objects
- Part II. In Review
- Part III: At a Glance
- Day 11. Extending HTML with XHTML
- Day 12. Putting XHTML to Work
- Day 13. Creating Graphics and Multimedia: SVG and SMIL
- Day 14. Handling XLinks, XPointers, and XForms
- Part III. In Review
- Part IV: At a Glance
- Day 15. Using JavaScript and XML
- Day 16. Using Java and .NET: DOM
- Day 17. Using Java and .NET: SAX
- Day 18. Working with SOAP and RDF
- Part IV. In Review
- Part V: At a Glance
- Day 19. Handling XML Data Binding
- Day 20. Working with XML and Databases
- Day 21. Handling XML in .NET
- Part V. In Review
- Appendix A. Quiz Answers
Day 8. Formatting XML by Using Cascading Style Sheets
Say that you want to take a look at the data in an XML document by using a browser. You might be out of luck unless you're using a specialized XML browser that can handle the particular XML markup you're using, such as the W3C Amaya browser that handles MathML. However, there are very few specialized XML browsers out there, and there's a great deal of XML. Don't you have any other options? You do. For one, you can use Cascading Style Sheets (CSS). Many browsers, such as Netscape Navigator and Internet Explorer, let you use CSS to format the data in XML documents for display, and today you're going to see how that works. It's getting more and more common to see CSS-formatted XML on the Web, and it often makes sense to display data by using CSS. You might want to create a table, for example, which is a lot easier on the eyes than a 40-page XML document.
Here's an overview of today's topics:
- Creating CSS style sheets and CSS rules
- Using CSS style sheets with XML documents
- Selecting elements in style sheets
- Grouping elements
- Creating CSS classes
- Selecting elements by ID
- Using inline styles
- Using block elements
- Formatting text
- Aligning text
- Creating margins
- Displaying images
- Creating lists
- Creating tables
Our Sample XML Document | Next Section