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
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
com.deltaxml.api package in
XML Compare; if you do not already have this
software a time-limited evalution 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 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: http://ant.apache.org.
Finally, some of the example work best using the Saxon XSLT processor. We recommend using version 6.5.3 available from: http://saxon.sourceforge.net/.
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.
You can explore the individual examples listed below by downloading pipelines.zip and unpacking all the examples in a single bundle.
|Example||Description||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.||Yes|
|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.||Yes|
|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.||Yes|
While it is possible to statically configure the final stage of an XSLT based
pipeline component, using the ||No|
|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.||No|
|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.||No|