XProc is an XML Pipeline Language, which is being defined by the folks at the XML Processing Model Working Group. Norm has an experimental implementation, hosted at https://xproc.dev.java.net/. The release notes are here.
Naturally enough, this is as a Netbeans project - but I thought I'd give it a try using Eclipse. It was pretty easy in the end:
- Start your favourite Eclipse version - I used 3.3
- Add in a Subversion plugin (since dev.java.net uses subversion). I've been using Subclipse lately. See http://subclipse.tigris.org/ for more details.
- Point your SVN explorer to the repository https://xproc.dev.java.net/svn/xproc
- Check out as a new Java Project using the Wizard.
- Download (some of) the required frameworks ... I found that I could get by with Saxon 6.5 and Saxon 9 to get started. Add these .jars to the build path. Also note that you should add saxon9-s9api.jar as well as saxon9.jar.
- Adjust the build path - so that these two directories are used as the java source:
java/src
java
The second is required, since a number of configuration files are referenced using a path like /etc/configuration.xml and as such, they need to be findable on the classpath. Eclipse will make sure that you exclude java/src from this include. Your classpath should look something like this: - I used the xproc.Driver class to do a simple test. It was not long before I realized that things were not happy due to my running on a Windows box. I needed to change this line:
hash.put(port, "file://" + fn);
to this:
hash.put(port, "file://" + "/" + fn); - I then needed to use this sort of command line arguments:
-i source=c:\fred.xml java/samples/count.xpl
This just runs the count pipeline against a simple xml document.
Here's a screenshot of the project contents:
Note that some errors are shown (since not all required libraries are provided), and that all three of the saxon libs are required.
And for good measure, here's a screen shot of a successful run:
No comments:
Post a Comment