1 package com.icl.saxon.output; 2 import com.icl.saxon.*; 3 import org.xml.sax.Attributes ; 4 import java.util.Properties ; 5 import javax.xml.transform.TransformerException ; 6 import javax.xml.transform.Result ; 7 import javax.xml.transform.OutputKeys ; 8 import javax.xml.transform.stream.StreamResult ; 9 import javax.xml.transform.dom.DOMResult ; 10 import javax.xml.transform.sax.SAXResult ; 11 import java.io.*; 12 13 20 21 public abstract class Outputter { 22 23 protected Emitter emitter; 24 25 29 30 public Emitter getEmitter() throws TransformerException { 31 reset(); 32 return emitter; 33 } 34 35 38 39 public abstract void reset() throws TransformerException ; 40 41 public abstract Properties getOutputProperties(); 42 43 47 48 public final void setEscaping(boolean escaping) throws TransformerException { 49 emitter.setEscaping(escaping); 50 } 51 52 55 56 public final void open() throws TransformerException { 57 emitter.startDocument(); 59 } 60 61 67 68 public abstract void write(String s) throws TransformerException ; 69 70 77 78 public abstract void writeContent(String s) throws TransformerException ; 79 80 89 90 public abstract void writeContent(char[] chars, int start, int length) 91 throws TransformerException ; 92 93 99 100 public abstract void writeStartTag(int nameCode) throws TransformerException ; 101 102 109 110 public abstract int checkAttributePrefix(int nameCode) throws TransformerException ; 111 112 122 123 public abstract void writeNamespaceDeclaration(int nscode) 124 throws TransformerException ; 125 126 130 131 public abstract void copyNamespaceNode(int nscode) throws TransformerException ; 132 133 137 138 public abstract boolean thereIsAnOpenStartTag(); 139 140 150 151 public void writeAttribute(int nameCode, String value) throws TransformerException { 152 writeAttribute(nameCode, value, false); 153 } 154 155 169 170 public abstract void writeAttribute(int nameCode, String value, boolean noEscape) 171 throws TransformerException ; 172 173 174 178 179 public abstract void writeEndTag(int nameCode) throws TransformerException ; 180 181 184 185 public abstract void writeComment(String comment) throws TransformerException ; 186 187 190 191 public abstract void writePI(String target, String data) throws TransformerException ; 192 193 196 197 public abstract void close() throws TransformerException ; 198 199 200 } 201 202 | Popular Tags |