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

All Implemented Interfaces:
    ErrorHandler, EntityResolver, DocumentHandler, DTDHandler

A sample SAX writer. This sample program illustrates how to register a SAX DocumentHandler 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 SAXWriter(boolean canonical) throws UnsupportedEncodingException 
    Default constructor.
 protected SAXWriter(String encoding,
    boolean canonical) throws UnsupportedEncodingException 
Method from sax.SAXWriter Summary:
characters,   endDocument,   endElement,   error,   fatalError,   ignorableWhitespace,   main,   normalize,   print,   processingInstruction,   sortAttributes,   startDocument,   startElement,   warning
Methods from org.xml.sax.HandlerBase:
characters,   endDocument,   endElement,   error,   fatalError,   ignorableWhitespace,   notationDecl,   processingInstruction,   resolveEntity,   setDocumentLocator,   startDocument,   startElement,   unparsedEntityDecl,   warning
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from sax.SAXWriter Detail:
 public  void characters(char[] ch,
    int start,
    int length) 
    Characters.
 public  void endDocument() 
    End document.
 public  void endElement(String name) 
    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 AttributeList sortAttributes(AttributeList attrs) 
    Returns a sorted list of attributes.
 public  void startDocument() 
    Start document.
 public  void startElement(String name,
    AttributeList attrs) 
    Start element.
 public  void warning(SAXParseException ex) 
    Warning.