1 package net.sf.saxon.event; 2 import net.sf.saxon.om.Item; 3 import net.sf.saxon.om.NodeInfo; 4 import net.sf.saxon.trans.XPathException; 5 6 9 10 public class TeeOutputter extends SequenceReceiver { 11 12 SequenceReceiver seq1; 13 SequenceReceiver seq2; 14 15 public TeeOutputter(SequenceReceiver seq1, SequenceReceiver seq2) { 16 this.seq1 = seq1; 17 this.seq2 = seq2; 18 } 19 20 23 24 public void append(Item item, int locationId, int copyNamespaces) throws XPathException { 25 seq1.append(item, locationId, NodeInfo.ALL_NAMESPACES); 26 seq2.append(item, locationId, NodeInfo.ALL_NAMESPACES); 27 } 28 29 32 33 public void startDocument(int properties) throws XPathException { 34 seq1.startDocument(properties); 35 seq2.startDocument(properties); 36 } 37 38 41 42 public void endDocument() throws XPathException { 43 seq1.endDocument(); 44 seq2.endDocument(); 45 } 46 47 59 60 public void startElement(int nameCode, int typeCode, int locationId, int properties) throws XPathException { 61 seq1.startElement(nameCode, typeCode, locationId, properties); 62 seq2.startElement(nameCode, typeCode, locationId, properties); 63 } 64 65 78 79 public void namespace(int namespaceCode, int properties) throws XPathException { 80 seq1.namespace(namespaceCode, properties); 81 seq2.namespace(namespaceCode, properties); 82 } 83 84 99 100 public void attribute(int nameCode, int typeCode, CharSequence value, int locationId, int properties) throws XPathException { 101 seq1.attribute(nameCode, typeCode, value, locationId, properties); 102 seq2.attribute(nameCode, typeCode, value, locationId, properties); 103 } 104 105 111 112 public void startContent() throws XPathException { 113 seq1.startContent(); 114 seq2.startContent(); 115 } 116 117 121 122 public void endElement() throws XPathException { 123 seq1.endElement(); 124 seq2.endElement(); 125 } 126 127 141 142 public void characters(CharSequence chars, int locationId, int properties) throws XPathException { 143 seq1.characters(chars, locationId, properties); 144 seq2.characters(chars, locationId, properties); 145 } 146 147 160 161 public void processingInstruction(String name, CharSequence data, int locationId, int properties) throws XPathException { 162 seq1.processingInstruction(name, data, locationId, properties); 163 seq2.processingInstruction(name, data, locationId, properties); 164 } 165 166 178 179 public void comment(CharSequence content, int locationId, int properties) throws XPathException { 180 seq1.comment(content, locationId, properties); 181 seq2.comment(content, locationId, properties); 182 } 183 184 187 188 public void close() throws XPathException { 189 seq1.close(); 190 seq2.close(); 191 } 192 } 193 194 | Popular Tags |