23.6. Transforming XML with XSLT

XSLT is a language for transforming XML documents into HTML, XML, or other types of documents. When performing a transformation, an XSLT engine converts the XML document according to formatting rules and XPath addresses specified in an XML style sheet (XSL). The XPath information identifies the different parts of the XML document for processing, and the style sheet information identifies the layout of the output.

The benefit of XSLT is that you can define multiple style sheets for transforming a single XML document. For example, a database could return a query in an XML format, and depending on the client protocol, HTTP or WAP, a servlet could use different style sheets to convert the data into HTML or WML, respectively. ...

Get Core Web Programming, Second Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.