1 package com.nwalsh.saxon; 2 3 import java.util.Stack ; 4 import java.util.StringTokenizer ; 5 import org.xml.sax.*; 6 import org.w3c.dom.*; 7 import javax.xml.transform.TransformerException ; 8 import com.icl.saxon.Context; 9 import com.icl.saxon.expr.*; 10 import com.icl.saxon.expr.FragmentValue; 11 import com.icl.saxon.Controller; 12 import com.icl.saxon.functions.Extensions; 13 import com.icl.saxon.om.*; 14 import com.icl.saxon.output.*; 15 import com.icl.saxon.pattern.*; 16 import com.icl.saxon.tree.*; 17 18 49 public class CopyEmitter extends com.icl.saxon.output.Emitter { 50 51 protected FragmentValue rtf = null; 52 protected Emitter rtfEmitter = null; 53 54 58 protected NamePool namePool = null; 59 60 64 public CopyEmitter(Controller controller, NamePool namePool) { 65 rtf = new FragmentValue(controller); 66 rtfEmitter = rtf.getEmitter(); 67 this.namePool = namePool; 68 } 69 70 74 public FragmentValue getResultTreeFragment() { 75 return rtf; 76 } 77 78 79 public void characters(char[] chars, int start, int len) 80 throws TransformerException { 81 rtfEmitter.characters(chars, start, len); 82 } 83 84 85 public void comment(char[] chars, int start, int length) 86 throws TransformerException { 87 rtfEmitter.comment(chars, start, length); 88 } 89 90 91 public void endDocument() 92 throws TransformerException { 93 rtfEmitter.endDocument(); 94 } 95 96 97 public void endElement(int nameCode) 98 throws TransformerException { 99 rtfEmitter.endElement(nameCode); 100 } 101 102 103 public void processingInstruction(java.lang.String name, 104 java.lang.String data) 105 throws TransformerException { 106 rtfEmitter.processingInstruction(name, data); 107 } 108 109 110 public void setDocumentLocator(org.xml.sax.Locator locator) { 111 rtfEmitter.setDocumentLocator(locator); 112 } 113 114 115 public void setEscaping(boolean escaping) 116 throws TransformerException { 117 rtfEmitter.setEscaping(escaping); 118 } 119 120 121 public void setNamePool(NamePool namePool) { 122 rtfEmitter.setNamePool(namePool); 123 } 124 125 126 public void setUnparsedEntity(java.lang.String name, java.lang.String uri) 127 throws TransformerException { 128 rtfEmitter.setUnparsedEntity(name, uri); 129 } 130 131 132 public void setWriter(java.io.Writer writer) { 133 rtfEmitter.setWriter(writer); 134 } 135 136 137 public void startDocument() 138 throws TransformerException { 139 rtfEmitter.startDocument(); 140 } 141 142 143 public void startElement(int nameCode, 144 org.xml.sax.Attributes attributes, 145 int[] namespaces, 146 int nscount) 147 throws TransformerException { 148 rtfEmitter.startElement(nameCode, attributes, namespaces, nscount); 149 } 150 } 151 | Popular Tags |