.:: Quick links ::.
SourceForge
Freshmeat
Downloads
Documentation
Mailing list
|
IntroductionThe xmlenc library is a fast stream-based XML output library for Java. Main design goals are performance, simplicitity and pureness. As far as known, xmlenc is the fastest XML output library for Java. ExampleThe following code uses xmlenc to print a minimal XHTML document: import java.io.OutputStreamWriter; import org.znerd.xmlenc.*; public class Tester { public static void main(String[] args) throws Exception { XMLOutputter outputter = new XMLOutputter(new OutputStreamWriter(System.out), "US-ASCII"); outputter.startTag("html"); outputter.startTag("head"); outputter.startTag("title"); outputter.pcdata("Example document"); outputter.endTag(); // title outputter.endTag(); // head outputter.startTag("body"); outputter.pcdata("Example document"); outputter.endDocument(); // closes all tags and flushes the stream } } To test, save the code in a file called
Then to execute it, run the following command:
Note: On Windows platforms, you need to replace the colon
( Quick startTo get started quickly, download the JAR file, put it in your CLASSPATH and write your code using the API documentation as a guide. Building xmlencThe xmlenc library can be built as follows:
Hint: Run |
Valid XHTML 1.0 | $Id: index.html,v 1.10 2005/12/23 14:26:35 znerd Exp $ |