Package net.sf.saxon.event
Class NamePoolConverter
java.lang.Object
net.sf.saxon.event.SequenceReceiver
net.sf.saxon.event.ProxyReceiver
net.sf.saxon.event.NamePoolConverter
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.
The type annotations of nodes passed through this filter must be built-in types in the XSD namespace, because user-defined types belong to a specific Configuration and cannot readily be transferred. In practice the class is used only for untyped trees.
-
Field Summary
FieldsFields inherited from class net.sf.saxon.event.ProxyReceiver
nextReceiverFields inherited from class net.sf.saxon.event.SequenceReceiver
pipelineConfiguration, previousAtomic, systemIdFields inherited from interface javax.xml.transform.Result
PI_DISABLE_OUTPUT_ESCAPING, PI_ENABLE_OUTPUT_ESCAPING -
Constructor Summary
ConstructorsConstructorDescriptionNamePoolConverter(Receiver next, NamePool oldPool, NamePool newPool) Constructor -
Method Summary
Modifier and TypeMethodDescriptionvoidattribute(NodeName name, SimpleType type, CharSequence value, Location location, int properties) Handle an attributevoidstartElement(NodeName name, SchemaType type, Location location, int properties) Output element start tagMethods inherited from class net.sf.saxon.event.ProxyReceiver
append, characters, close, comment, endDocument, endElement, getNamePool, getNextReceiver, namespace, open, processingInstruction, setPipelineConfiguration, setSystemId, setUnderlyingReceiver, setUnparsedEntity, startContent, startDocument, usesTypeAnnotationsMethods inherited from class net.sf.saxon.event.SequenceReceiver
append, decompose, flatten, getConfiguration, getErrorCodeForDecomposingFunctionItems, getPipelineConfiguration, getSystemId, handlesAppend
-
Field Details
-
Constructor Details
-
NamePoolConverter
Constructor- Parameters:
next- the next receiver in the pipelineoldPool- the old namepoolnewPool- th new namepool
-
-
Method Details
-
startElement
public void startElement(NodeName name, SchemaType type, Location location, int properties) throws XPathException Output element start tag- Specified by:
startElementin interfaceReceiver- Overrides:
startElementin classProxyReceiver- Parameters:
name- integer code identifying the name of the element within the name pool.type- the element's type annotation.location- a location associated with the event (typically either a location in the source document or the stylesheet)properties- properties of the element node- Throws:
XPathException- if an error occurs
-
attribute
public void attribute(NodeName name, SimpleType type, CharSequence value, Location location, int properties) throws XPathException Handle an attribute- Specified by:
attributein interfaceReceiver- Overrides:
attributein classProxyReceiver- Parameters:
name- The name of the attributetype- The type of the attributevalue- the string value of the attributelocation- The location of the nodeproperties- Bit significant value. The following bits are defined:- DISABLE_ESCAPING
- Disable escaping for this attribute
- NO_SPECIAL_CHARACTERS
- Attribute value contains no special characters
- Throws:
XPathException- if an error occurs
-