com.nwalsh.saxon
Class CopyEmitter

java.lang.Object
  extended bycom.icl.saxon.output.Emitter
      extended bycom.nwalsh.saxon.CopyEmitter
All Implemented Interfaces:
Result
Direct Known Subclasses:
CalloutEmitter, ColumnUpdateEmitter, NumberLinesEmitter, UnwrapLinksEmitter

public class CopyEmitter
extends Emitter

A Saxon 6.0 Emitter that clones its input.

$Id: CopyEmitter.java,v 1.1 2001/07/16 21:23:57 nwalsh Exp $

Copyright (C) 2000 Norman Walsh.

This class provides a Saxon 6.* implementation of an emitter that manufactures a cloned result tree fragment.

The purpose of this emitter is to provide something for CalloutEmitter and NumberLinesEmitter to extend. This emitter simply copies all input to a new result tree fragment.

Change Log:

1.0

Initial release.

Version:
$Id: CopyEmitter.java,v 1.1 2001/07/16 21:23:57 nwalsh Exp $
Author:
Norman Walsh ndw@nwalsh.com
See Also:
CalloutEmitter, NumberLinesEmitter

Field Summary
protected  NamePool namePool
          The namePool.
protected  FragmentValue rtf
          The result tree fragment containing the copied fragment.
protected  Emitter rtfEmitter
           
 
Fields inherited from class com.icl.saxon.output.Emitter
locator, outputProperties, outputStream, systemId, writer
 
Fields inherited from interface javax.xml.transform.Result
PI_DISABLE_OUTPUT_ESCAPING, PI_ENABLE_OUTPUT_ESCAPING
 
Constructor Summary
CopyEmitter(Controller controller, NamePool namePool)
          Constructor for the CopyEmitter.
 
Method Summary
 void characters(char[] chars, int start, int len)
          Copy characters.
 void comment(char[] chars, int start, int length)
          Copy comments.
 void endDocument()
          Copy end document events.
 void endElement(int nameCode)
          Copy end element events.
 FragmentValue getResultTreeFragment()
          Return the result tree fragment constructed by replaying events through this emitter.
 void processingInstruction(String name, String data)
          Copy processing instructions.
 void setDocumentLocator(Locator locator)
          Copy set document locator events.
 void setEscaping(boolean escaping)
          Copy set escaping events.
 void setNamePool(NamePool namePool)
          Copy set name pool events.
 void setUnparsedEntity(String name, String uri)
          Copy set unparsed entity events.
 void setWriter(Writer writer)
          Copy set writer events.
 void startDocument()
          Copy start document events.
 void startElement(int nameCode, Attributes attributes, int[] namespaces, int nscount)
          Copy start element events.
 
Methods inherited from class com.icl.saxon.output.Emitter
getNamePool, getOutputProperties, getOutputStream, getSystemId, getWriter, makeEmitter, setOutputProperties, setOutputStream, setSystemId, usesWriter
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

rtf

protected FragmentValue rtf
The result tree fragment containing the copied fragment.


rtfEmitter

protected Emitter rtfEmitter

namePool

protected NamePool namePool

The namePool.

Copied from the caller, it should be the runtime name pool.

Constructor Detail

CopyEmitter

public CopyEmitter(Controller controller,
                   NamePool namePool)

Constructor for the CopyEmitter.

Parameters:
namePool - The name pool to use for constructing elements and attributes.
Method Detail

getResultTreeFragment

public FragmentValue getResultTreeFragment()

Return the result tree fragment constructed by replaying events through this emitter.


characters

public void characters(char[] chars,
                       int start,
                       int len)
                throws TransformerException
Copy characters.

Throws:
TransformerException

comment

public void comment(char[] chars,
                    int start,
                    int length)
             throws TransformerException
Copy comments.

Throws:
TransformerException

endDocument

public void endDocument()
                 throws TransformerException
Copy end document events.

Throws:
TransformerException

endElement

public void endElement(int nameCode)
                throws TransformerException
Copy end element events.

Throws:
TransformerException

processingInstruction

public void processingInstruction(String name,
                                  String data)
                           throws TransformerException
Copy processing instructions.

Throws:
TransformerException

setDocumentLocator

public void setDocumentLocator(Locator locator)
Copy set document locator events.


setEscaping

public void setEscaping(boolean escaping)
                 throws TransformerException
Copy set escaping events.

Throws:
TransformerException

setNamePool

public void setNamePool(NamePool namePool)
Copy set name pool events.


setUnparsedEntity

public void setUnparsedEntity(String name,
                              String uri)
                       throws TransformerException
Copy set unparsed entity events.

Throws:
TransformerException

setWriter

public void setWriter(Writer writer)
Copy set writer events.


startDocument

public void startDocument()
                   throws TransformerException
Copy start document events.

Throws:
TransformerException

startElement

public void startElement(int nameCode,
                         Attributes attributes,
                         int[] namespaces,
                         int nscount)
                  throws TransformerException
Copy start element events.

Throws:
TransformerException