X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=unused%2Fxml%2Fsax%2Fdemo%2FCharacterStreamDemo.java;fp=unused%2Fxml%2Fsax%2Fdemo%2FCharacterStreamDemo.java;h=8d97f0fbe9a2e8feb21d686150f266007cd596b3;hb=ec8f3cedf60fb1feed6d34de6b49f6bfa78b9dd8;hp=0000000000000000000000000000000000000000;hpb=056dad85a910551cc95e44d451a61f6b8c4dd35d;p=jalview.git diff --git a/unused/xml/sax/demo/CharacterStreamDemo.java b/unused/xml/sax/demo/CharacterStreamDemo.java new file mode 100644 index 0000000..8d97f0f --- /dev/null +++ b/unused/xml/sax/demo/CharacterStreamDemo.java @@ -0,0 +1,88 @@ +package org.xml.sax.demo; +// SAX demonstration for parsing from a UTF-16 character stream. +// No warranty; no copyright -- use this as you will. +// $Id: CharacterStreamDemo.java,v 1.3 1998/05/01 20:44:33 david Exp $ + +import org.xml.sax.Parser; +import org.xml.sax.InputSource; +import org.xml.sax.SAXException; + +import org.xml.sax.helpers.ParserFactory; + +import java.io.StringReader; + + +/** + * Demonstrate parsing from a UTF-16 character stream. + * + *
Usage: java -Dorg.xml.sax.parser=CLASSNAME + * CharacterStreamDemo
+ * + *The SAX parser will read the document from a character + * stream connected to an internal string.
+ * + *Note that the Java implementation of SAX represents a + * character stream using a Reader.
+ * + * @see DemoHandler + * @see org.xml.org.xml.sax.parser + * @see org.xml.sax.InputSource + * @see org.xml.sax.helpers.ParserFactory + * @see java.io.StringReader + */ +public class CharacterStreamDemo { + + // This is the document, in all its glory. + // In a read-world application, this + // could come from a database, a text + // field, or just about anywhere. + final static String doc = "" + + "