net.ontopia.xml
Class CanonicalPrinter
java.lang.Object
net.ontopia.xml.CanonicalPrinter
- All Implemented Interfaces:
- DocumentHandler
- Direct Known Subclasses:
- CanonicalTopicMapWriter.CanonicalXTMPrinter
public class CanonicalPrinter
- extends Object
- implements DocumentHandler
INTERNAL: SAX document handler that prints canonical XML. Note that
this does not support all of http://www.w3.org/TR/xml-c14n, only
what is needed for Canonical XTM.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
writer
protected PrintWriter writer
CanonicalPrinter
public CanonicalPrinter(OutputStream stream)
throws UnsupportedEncodingException
- Creates a CanonicalPrinter that writes to the given OutputStream.
The encoding used is always utf-8.
- Throws:
UnsupportedEncodingException
CanonicalPrinter
public CanonicalPrinter(Writer writer)
- Creates a CanonicalPrinter that writes to the given Writer.
startDocument
public void startDocument()
- Specified by:
startDocument
in interface DocumentHandler
startElement
public void startElement(String name,
AttributeList atts)
- Specified by:
startElement
in interface DocumentHandler
endElement
public void endElement(String name)
- Specified by:
endElement
in interface DocumentHandler
characters
public void characters(char[] ch,
int start,
int length)
- Specified by:
characters
in interface DocumentHandler
ignorableWhitespace
public void ignorableWhitespace(char[] ch,
int start,
int length)
- Specified by:
ignorableWhitespace
in interface DocumentHandler
processingInstruction
public void processingInstruction(String target,
String data)
- Specified by:
processingInstruction
in interface DocumentHandler
endDocument
public void endDocument()
- Specified by:
endDocument
in interface DocumentHandler
setDocumentLocator
public void setDocumentLocator(Locator locator)
- Specified by:
setDocumentLocator
in interface DocumentHandler
escape
public String escape(String attrval)
Copyright © 2000-2012 Ontopia.