XML Links   XML Tools   XML Books   XML & XSLT Examples   

XML and XSLT Examples

Some simple XSLT examples

Obsolete examples

Simple transformation using an old IE 5 type style sheet (1-ie.xml) styled with (1-ie.xsl)

Transformation using an old IE 5 type style sheet (all-ie2.xml) styled with (all-ie-b.xsl)
  This style sheet uses an external CSS style sheet to define screen appearance and uses "order-by" to sort the books by title.

Transformation using an old IE 5 type style sheet (books3.xml) styled with (books-ie.xsl)
  This style sheet is an example of selecting attributes of XML documents (the price attribute of the amazon element) and outputing HTML attributes (the href for the amazon link).

More recent examples

Simple transformation using a new (IE 6, IE 5 with MSXML 3+, or Mozilla) type style sheet (1.xml) styled with (1.xsl)

Simple transformation using a new (IE 6, IE 5 with MSXML 3+, or Mozilla) type style sheet (which employs an embedded CSS style sheet) (4.xml) styled with (4.xsl)

Transformation using a new (IE 6, IE 5 with MSXML 3+, or Mozilla) type style sheet (all-ie.xml) styled with (all-ie.xsl)
  This style sheet used the later, standards-compliant method (xsl:sort) for ordering a document.

Transformation showing the creation of HTML attributes ("href" for <a> in this example), the reading of XML file attributes, using xsl:choose to display a price in red when it's over $10.40, and using the sum() function to total prices.
  XML file
  Style sheet

Simple data binding example

Simple example of data binding (Requires Internet Explorer) (books.html) using books.xml as it's data source.

XLink examples

(Requires Netscape Navigator 6+ or Mozilla) -- the links at the top of these files are implementations of XLink

XML Schema example

The file books2.xml has the schema books2.xsd applied to it.
There are a couple errors in the books2.xml file which can be seen by running it against the W3C Schema Validator.