net.sf.saxon.event

Class NamePoolConverter

Implemented Interfaces:
Receiver, Result

public class NamePoolConverter
extends ProxyReceiver

This class is a filter that passes all Receiver events through unchanged, except that it changes namecodes to allow for the source and the destination using different NamePools. This is necessary when a stylesheet has been constructed as a general document (e.g. as the result of a transformation) and is passed to newTemplates() to be compiled as a stylesheet.
Author:
Michael Kay

Field Summary

Fields inherited from class net.sf.saxon.event.ProxyReceiver

nextReceiver

Fields inherited from class net.sf.saxon.event.SequenceReceiver

pipelineConfiguration, previousAtomic, systemId

Constructor Summary

NamePoolConverter(NamePool oldPool, NamePool newPool)
Constructor

Method Summary

void
attribute(int nameCode, int typeCode, CharSequence value, int locationId, int properties)
Handle an attribute
void
namespace(int namespaceCode, int properties)
Handle a namespace
void
setUnderlyingReceiver(Receiver receiver)
Set the underlying emitter.
void
startElement(int nameCode, int typeCode, int locationId, int properties)
Output element start tag

Methods inherited from class net.sf.saxon.event.ProxyReceiver

append, attribute, characters, close, comment, endDocument, endElement, getConfiguration, getDocumentLocator, getNamePool, getUnderlyingReceiver, namespace, open, processingInstruction, setPipelineConfiguration, setSystemId, setUnderlyingReceiver, setUnparsedEntity, startContent, startDocument, startElement

Methods inherited from class net.sf.saxon.event.SequenceReceiver

append, getConfiguration, getNamePool, getPipelineConfiguration, getSystemId, open, setPipelineConfiguration, setSystemId, setUnparsedEntity

Constructor Details

NamePoolConverter

public NamePoolConverter(NamePool oldPool,
                         NamePool newPool)
Constructor

Method Details

attribute

public void attribute(int nameCode,
                      int typeCode,
                      CharSequence value,
                      int locationId,
                      int properties)
            throws XPathException
Handle an attribute
Specified by:
attribute in interface Receiver
Overrides:
attribute in interface ProxyReceiver

namespace

public void namespace(int namespaceCode,
                      int properties)
            throws XPathException
Handle a namespace
Specified by:
namespace in interface Receiver
Overrides:
namespace in interface ProxyReceiver

setUnderlyingReceiver

public void setUnderlyingReceiver(Receiver receiver)
Set the underlying emitter. This call is mandatory before using the Emitter. This version is modified from that of the parent class to avoid setting the namePool of the destination Receiver.
Overrides:
setUnderlyingReceiver in interface ProxyReceiver

startElement

public void startElement(int nameCode,
                         int typeCode,
                         int locationId,
                         int properties)
            throws XPathException
Output element start tag
Specified by:
startElement in interface Receiver
Overrides:
startElement in interface ProxyReceiver