Class CalloutEmitter


public class CalloutEmitter
extends CopyEmitter

Saxon extension to decorate a result tree fragment with callouts.

$Id:,v 1.2 2000/11/28 23:05:55 ndw Exp $

Copyright (C) 2000 Norman Walsh.

This class provides the guts of a Saxon 6.* implementation of callouts for verbatim environments. (It is used by the Verbatim class.)

The general design is this: the stylesheets construct a result tree fragment for some verbatim environment. The Verbatim class initializes a CalloutEmitter with information about the callouts that should be applied to the verbatim environment in question. Then the result tree fragment is "replayed" through the CalloutEmitter; the CalloutEmitter builds a new result tree fragment from this event stream, decorated with callouts, and that is returned.

Change Log:


Initial release.

See Also:

Constructor Summary
CalloutEmitter( namePool, java.lang.String graphicsPath, java.lang.String graphicsExt, int graphicsMax, int defaultColumn, boolean foStylesheet)
          Constructor for the CalloutEmitter.
Method Summary
 void characters(char[] chars, int start, int len)
          Process characters.
 void endElement(int nameCode)
          Process end element events.
 void setupCallouts(com.icl.saxon.expr.NodeSetIntent areaspecNodeSet)
          Examine the areaspec and determine the number and position of callouts.
 void startElement(int nameCode, org.xml.sax.Attributes attributes, int[] namespaces, int nscount)
          Process start element events.
Methods inherited from class com.nwalsh.saxon6.CopyEmitter
comment, endDocument, getResultTreeFragment, processingInstruction, setCharacterSet, setDocumentLocator, setEscaping, setNamePool, setOutputDetails, setUnparsedEntity, setWriter, startDocument
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail


public CalloutEmitter( namePool,
                      java.lang.String graphicsPath,
                      java.lang.String graphicsExt,
                      int graphicsMax,
                      int defaultColumn,
                      boolean foStylesheet)

Constructor for the CalloutEmitter.

namePool - The name pool to use for constructing elements and attributes.
graphicsPath - The path to callout number graphics.
graphicsExt - The extension for callout number graphics.
graphicsMax - The largest callout number that can be represented as a graphic.
defaultColumn - The default column for callouts.
foStylesheet - Is this an FO stylesheet?
Method Detail


public void setupCallouts(com.icl.saxon.expr.NodeSetIntent areaspecNodeSet)

Examine the areaspec and determine the number and position of callouts.

The areaspecNodeSet is examined and a sorted list of the callouts is constructed.

This data structure is used to augment the result tree fragment with callout bullets.

areaspecNodeSet - The source document <areaspec> element.


public void characters(char[] chars,
                       int start,
                       int len)
                throws org.xml.sax.SAXException
Process characters.
characters in class CopyEmitter


public void endElement(int nameCode)
                throws org.xml.sax.SAXException
Process end element events.
endElement in class CopyEmitter


public void startElement(int nameCode,
                         org.xml.sax.Attributes attributes,
                         int[] namespaces,
                         int nscount)
                  throws org.xml.sax.SAXException
Process start element events.
startElement in class CopyEmitter