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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.