Beginning XML Databases (Wrox Beginning Guides)

As you saw in Chapter 1, XSL is essentially a formatting or text parsing language. Formatting refers to applying consistent pictures to XML data where repeated element structures of XML data can be displayed in a consistent manner. For example, a set of rows from a relational database table stored as an XML document can be very easily displayed by applying the same template to each row (see Chapter 1, Figure 1-2). A text parsing language is a programming or scripting language that can be used to filter in (or out) both wanted and unwanted data. In terms of XML documents, XSL can be used to dig down into the hierarchical tree structure of an XML document and retrieve only the elements you want to see displayed. In other words, using XSL as an XML document text parser allows you to select parts of an XML document to retrieve. For example, Figure 1-7 in Chapter 1 used an XSL style sheet templating operation to format and apply filtering, returning only the names of continents and countries , ignoring all population data.

The Roots of XSL

XSL began as just XSL. Now it seems to be called XSL, XSLT, XPath, and even XSL-FO. What are all these things?

XHTML is a more restrictive and cleaner version of HTML.

This chapter will not cover XML-FO and XPath specifically . This chapter is all about the basics of XSL formatting and parsing of XML documents. Thus the original form of the W3C XSL definition will be used with a Microsoft bent. Once again, the subject matter of this book is XML as it relates to relational databases and native XML databases. Therefore, any coverage of XML, the XML DOM, XSL, and other tools is kept as simple as possible. This forces the focus on the database aspect of XML technology.

The objective is to demonstrate how XSL can be used to format and filter XML documents. The objective is not to describe all the miniscule details of XML and all its related tools, toys, and scripting languages. Some of these extra scripting languages are covered elsewhere in this book, at the appropriate juncture, and if applicable to the topic at hand.

XSL syntax can be divided into three general sections: elements, methods , and pattern matching characters . Lets begin with the syntax of XSL elements.

Категории