Skip to main content
Skip table of contents

JAXP Pipeline Examples

The following sample programs demonstrate various aspects of JAXP pipeline construction.  They are appropriate for under-the-hood use of the DeltaXML software, however following the introduction of the XML Compare 3.0 release and the PipelinedComparator class, we would suggest DeltaXML users consider using this class before using JAXP and the techniques described here.

This is a work in progress with the aim of providing a wide range of examples and descriptive text to form a complete tutorial for this topic.


Some of the example pipelines use the DeltaXML XMLComparator class  from com.deltaxml.api package in XML Compare; if you do not already have this software a time-limited evaluation can be requested. The concepts in these examples are also relevant to both JAXP and compatible products such as the XML Compare API; some examples use JAXP without DeltaXML software.  A column in the table below indicates if the example requires DeltaXML or JAXP.

The examples can be compiled and run using a J2SE 1.4 or later JDK (a javac compiler is needed, so the JRE is not appropriate).
The JDK for a number of platforms is available from

Ant build scripts are provided to make compiling and running the examples easier.  While not compulsory we would recommend using Ant. It is available from:

Finally, some of the example work best using the Saxon XSLT processor. We recommend using version 6.5.3 available from:

Pipeline paper

A paper which was developed in conjunction with these examples was presented at XML2004 (Washington DC, November 2004).  Please see our Articles and Papers page for further details.

The Examples

You can explore the individual examples listed below by downloading Download Files and unpacking all the examples in a single bundle.



XML Compare API required

Stream File

The Stream File example is one of the simplest possible pipelines. It demonstrates how a single JAXP pipeline component can utilize File IO.


Stream String

This example shows how IO can be performed to and from Java Strings. This may be useful when strings are associated with an internal storage buffer for a database or GUI widget.


Parser Control

Parsers used at the start of a pipeline may need special configuration of certain types of XML processing. This example shows how SAX parsers can be configured and integrated into a pipeline. This example also shows some aspects of pull-mode processing.


Output Control

While it is possible to statically configure the final stage of an XSLT based pipeline component, using the <xsl:output> statement, it may be necessary to configure aspects such as indentation at runtime. This example demonstrates a technique which can be used with triggered and push-mode pipeline components.


Five Stage

This example demonstrates how pull-mode, triggered and push-mode pipeline components can be integrated together. The pipeline consists of a sequence of 5 XSLT processing stages.


Doctype Preservation

Some pipeline components are not DOCTYPE aware. This example demonstrate a technique for determining the input DOCTYPE (using pre-parsing) and then reinstating it at the end of the pipeline. It borrows some techniques from the Output and Parser Control examples.


JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.