XML technologies / XSLT / Java and XSLT / XSLT processing with Java
(Excerpt from “Java und XSLT” by Eric M. Burke)
Many XSLT processors are written in Java, so they can also be called directly from a Java application or servlet. Embedding a processor in a Java application generally requires only adding one or two JAR files to CLASSPATH and calling the appropriate methods. This chapter shows how to do that and presents many further programming techniques.
When an XSLT processor such as Xalan is called from the command line, it expects the locations of an XML file and an XSLT stylesheet as parameters. After an XML parser such as Xerces or Crimson loads both files into memory, the transformation runs. Calling the XSLT processor programmatically removes the restriction to static files: you can send it a precompiled stylesheet and a dynamically generated DOM tree, or even submit SAX events as processor input. Avoiding unnecessary parsing is an important goal and can dramatically improve performance.
This chapter covers Java and XSLT programming techniques for standalone applications and servlets, focusing on Sun’s Java API for XML Processing (JAXP). In Servlet basics and XSLT we will apply these techniques to servlets and examine concurrency, server deployment and performance.
Copyright © 2002 O'Reilly Verlag GmbH & Co. KG
You may print the online version for your private use.
Otherwise, this chapter from “Java und XSLT” is subject to the same conditions as the bound edition. The work, including all its parts, is protected by copyright. All rights reserved, including reproduction, translation, microfilming, and storage and processing in electronic systems.
O’Reilly Verlag GmbH & Co. KG, Balthasarstraße 81, 50670 Köln, kommentar(at)oreilly.de
back to top