Run Java Programs that Process XML
Open source, command-line Java programs that process XML are abundant. This hack shows you how to use them.
The Java programming language (http://java.sun.com) has been a popular object-oriented language since it was unveiled by Sun in the mid-1990s. One key idea behind Java was that it made it possible to write and compile a program once, and then run it on any machine that supports a Java interpreter (“write once, run anywhere”). Note that it’s not a perfect programming language—I’ve heard Ted Ts’o (http://thunk.org/tytso/) say of Java, “Write once, run screaming.”
Nonetheless, Java is widespread and generally well liked, and you’ll find many command-line Java programs that can process XML in one way or another. A number of these programs appear in this book, so this hack walks you through how to use them.
Tip
This hack assumes that you know little to nothing about Java. If you are entirely new to Java, the information at http://java.sun.com/learning/new2java/ will also help you get up to speed quickly.
To get a Java program to run on your system, you need a Java virtual machine (VM), part of the Java runtime environment (JRE). One may already be on your system, but to get the latest JRE anyway, go to http://java.sun.com and find the link for the Java VM download. (There are alternatives to Sun’s VM, such as one offered on http://www.kaffe.org/, but I’m only going to talk about the Sun VM here.) In a few clicks, the new VM will be downloaded ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access