# Invoking XSLT from an application

Rather than using the XSLT interpreter from the command line, you may want to include it in your own application, perhaps one that enables it to be used within an applet or servlet. If you run the interpreter repeatedly, this will always be much faster than running it each time from a command line.

There are several APIs you can use to invoke Saxon's XSLT processor from an application.

The JAXP interface (Java)

On the Java platform, Saxon incorporates support for the standard JAXP transformation API (originally known as TrAX). This is compatible with the API for invoking other XSLT processors such as Xalan and Oracle.

This API is described in the documentation provided with JDK 1.4. It is available online at http://java.sun.com/j2se/1.4/docs/api/ Look for the javax.xml.transform package.

The s9api interface (Java)

Alternatively, you can use Saxon's own s9api interface. This is designed to provide an integrated approach to XML processing across the different range of languages supported by Saxon; unlike JAXP, it includes support for XSLT 2.0 capabilities, and it also takes advantage of generics in Java 5.

The Saxon.Api interface (.NET)

There is also an API for Saxon on the .NET platform, designed to make Saxon available from .NET languages such as C#, VB.NET, and ASP.NET. See Saxon on .NET.

Links

- Using s9api for Transformations

- Using JAXP for Transformations

Next