Save This Page
Home » Xerces-J-src.2.9.1 » sax » [javadoc | source]
sax
public class: SAX2Writer [javadoc | source]
java.lang.Object
   org.xml.sax.helpers.DefaultHandler
      sax.SAX2Writer

All Implemented Interfaces:
    ErrorHandler, EntityResolver, ContentHandler, DTDHandler

A sample SAX2 writer. This sample program illustrates how to register a SAX2 ContentHandler and receive the callbacks in order to print a document that is parsed.
Field Summary
protected  PrintWriter out    Print writer. 
protected  boolean canonical    Canonical output. 
Constructor:
 public SAX2Writer(boolean canonical) throws UnsupportedEncodingException 
    Default constructor.
 protected SAX2Writer(String encoding,
    boolean canonical) throws UnsupportedEncodingException 
Method from sax.SAX2Writer Summary:
characters,   endElement,   error,   fatalError,   ignorableWhitespace,   main,   normalize,   print,   processingInstruction,   sortAttributes,   startDocument,   startElement,   warning
Methods from org.xml.sax.helpers.DefaultHandler:
characters,   endDocument,   endElement,   endPrefixMapping,   error,   fatalError,   ignorableWhitespace,   notationDecl,   processingInstruction,   resolveEntity,   setDocumentLocator,   skippedEntity,   startDocument,   startElement,   startPrefixMapping,   unparsedEntityDecl,   warning
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from sax.SAX2Writer Detail:
 public  void characters(char[] ch,
    int start,
    int length) 
    Characters.
 public  void endElement(String uri,
    String local,
    String raw) 
    End element.
 public  void error(SAXParseException ex) 
    Error.
 public  void fatalError(SAXParseException ex) throws SAXException 
    Fatal error.
 public  void ignorableWhitespace(char[] ch,
    int start,
    int length) 
    Ignorable whitespace.
 public static  void main(String[] argv) 
    Main program entry point.
 protected String normalize(String s) 
    Normalizes the given string.
 public static  void print(String parserName,
    String uri,
    boolean canonical) 
    Prints the output from the SAX callbacks.
 public  void processingInstruction(String target,
    String data) 
    Processing instruction.
 protected Attributes sortAttributes(Attributes attrs) 
    Returns a sorted list of attributes.
 public  void startDocument() 
    Start document.
 public  void startElement(String uri,
    String local,
    String raw,
    Attributes attrs) 
    Start element.
 public  void warning(SAXParseException ex) 
    Warning.