XML Sample

The following sample demonstrates the Extensible Stylesheet Language Transformer (XSLT). The XSLT takes an XML (data) document and an XSL (stylesheet) document and outputs an HTML page which displays the data as defined by the stylesheet. The sample displays the same data (found in catalog.xml) in two different ways according to the stylesheet you use (either booklist1.xsl or booklist2.xsl). Alternatively, you can define your own XML and XSL documents and perform custom transformations.

Run this Sample with booklist1.xsl
Run this Sample with booklist2.xsl
Run a Customized XSLT Sample


How this sample works:

This sample has:

  • One XML data sheet, catalog.xml
  • Two XSL stylesheets, booklist1.xsl and booklist2.xsl.
  • A Java servlet that invokes the DefaultApplyServlet.
  • DefaultApplyServlet which uses an XML document and an XSL stylesheet to perform an XSLT transformation.

How to use this sample on your web page:

  • You can use the DefaultApplyServlet in this sample to transform your own XML files using your XSL stylesheets. Add this link to an HTML page to call the servlet and pass the URL of your files as parameters:
    /WebSphereSamples/servlet/WebSphereSamples.Xml.DefaultApplyXSL?URL={source xml URL}&xslURL={source xsl URL}
  • Developer's Notes