DeltaXML.com - Change Control For XML, In XML.(spacer) Home    About Us    Contact Us    Search
(spacer)

DeltaXML/JAXP Pipeline Examples

The following sample programs demonstrate various aspects of JAXP pipeline construction. 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.

Dependencies

Some of the example pipelines use the DeltaXML comparator from the DeltaXML Core API; if you do not already have this software a 2 week evaluation can be downloaded after registering on this website.

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

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: ant.apache.org.

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

Pipeline paper

A paper which was developed in conjunction with these examples will be presented at XML2004 (Washington DC, November 2004). While this covers a wider range of topics it will be useful reading in conjunction with the example code

The Examples

You can explore the individual examples listed below or download pipelines.zip and unpack all the examples in a single bundle.

Further examples will be added in the coming months, to provide more coverage of some missing aspects, so please check back here for future developments.

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.

 (spacer)Copyright © 2000-2005 DeltaXML Ltd, Malvern, UK. All rights reserved.
info@deltaxml.com