Package net.sf.saxon.serialize
Class MessageEmitter
- java.lang.Object
-
- net.sf.saxon.event.SequenceReceiver
-
- net.sf.saxon.serialize.Emitter
-
- net.sf.saxon.serialize.XMLEmitter
-
- net.sf.saxon.serialize.MessageEmitter
-
- All Implemented Interfaces:
Result,Receiver,ReceiverWithOutputProperties
public class MessageEmitter extends XMLEmitter
MessageEmitter is the default Receiver for xsl:message output. It is the same as XMLEmitter except that (a) it adds an extra newline at the end of the message, and (b) it recognizes a processing-instruction with name "error-code" specially; this is assumed to contain the error-code requested on thexsl:messageinstruction. These changes can be overridden in a user-supplied subclass.
-
-
Field Summary
-
Fields inherited from class net.sf.saxon.serialize.XMLEmitter
attSpecials, canonical, characterReferenceGenerator, declarationIsWritten, delimiter, elementCode, elementStack, indentForNextAttribute, openStartTag, specialInAtt, specialInAttSingle, specialInText, started, startedElement, undeclareNamespaces, unfailing
-
Fields inherited from class net.sf.saxon.serialize.Emitter
allCharactersEncodable, characterSet, outputProperties, outputStream, streamResult, writer
-
Fields inherited from class net.sf.saxon.event.SequenceReceiver
pipelineConfiguration, previousAtomic, systemId
-
Fields inherited from interface javax.xml.transform.Result
PI_DISABLE_OUTPUT_ESCAPING, PI_ENABLE_OUTPUT_ESCAPING
-
-
Constructor Summary
Constructors Constructor Description MessageEmitter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()End of the document.voidendDocument()Notify the end of a document nodevoidprocessingInstruction(String target, CharSequence data, Location locationId, int properties)Handle a processing instruction.voidsetPipelineConfiguration(PipelineConfiguration pipelineConfiguration)Set the pipeline configurationprotected booleansuppressProcessingInstruction(String target, CharSequence data, Location locationId, int properties)Method to decide whether a processing instruction in the message should be suppressed.-
Methods inherited from class net.sf.saxon.serialize.XMLEmitter
attribute, characters, closeStartTag, comment, convertToAscii, emptyElementTagCloser, endElement, getAttributeIndentString, isStarted, namespace, open, openDocument, setCharacterReferenceGenerator, setEscapeNonAscii, setIndentForNextAttribute, startContent, startDocument, startElement, testCharacters, usesTypeAnnotations, writeAttribute, writeCharSequence, writeDeclaration, writeDocType, writeDocTypeWithNullSystemId, writeEscape
-
Methods inherited from class net.sf.saxon.serialize.Emitter
append, getOutputProperties, getOutputStream, getWriter, makeOutputStream, makeWriter, setOutputProperties, setOutputStream, setStreamResult, setUnparsedEntity, setWriter, usesWriter
-
Methods inherited from class net.sf.saxon.event.SequenceReceiver
append, decompose, flatten, getConfiguration, getErrorCodeForDecomposingFunctionItems, getNamePool, getPipelineConfiguration, getSystemId, handlesAppend, setSystemId
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.sf.saxon.event.Receiver
append, getPipelineConfiguration, handlesAppend, setSystemId
-
Methods inherited from interface javax.xml.transform.Result
getSystemId
-
-
-
-
Method Detail
-
setPipelineConfiguration
public void setPipelineConfiguration(PipelineConfiguration pipelineConfiguration)
Description copied from interface:ReceiverSet the pipeline configuration- Specified by:
setPipelineConfigurationin interfaceReceiver- Overrides:
setPipelineConfigurationin classSequenceReceiver- Parameters:
pipelineConfiguration- the pipeline configuration
-
processingInstruction
public void processingInstruction(String target, CharSequence data, Location locationId, int properties) throws XPathException
Description copied from class:XMLEmitterHandle a processing instruction.- Specified by:
processingInstructionin interfaceReceiver- Overrides:
processingInstructionin classXMLEmitter- Parameters:
target- The PI name. This must be a legal name (it will not be checked).data- The data portion of the processing instructionlocationId- provides information such as line number and system ID.properties- Additional information about the PI.- Throws:
XPathException- if an error occurs
-
suppressProcessingInstruction
protected boolean suppressProcessingInstruction(String target, CharSequence data, Location locationId, int properties)
Method to decide whether a processing instruction in the message should be suppressed. The default implementation suppresses a processing instruction whose target is "error-code"; this processing instruction is inserted into the message; its data part is an EQName containing the error code.- Parameters:
target- the processing instruction target (that is, name)data- the data part of the processing instructionlocationId- the location, which in the case of the error-code processing instruction, holds the location of the originating xsl:message instructionproperties- currently 0.- Returns:
- true if the processing instruction is to be suppressed from the displayed message.
-
endDocument
public void endDocument() throws XPathExceptionDescription copied from class:XMLEmitterNotify the end of a document node- Specified by:
endDocumentin interfaceReceiver- Overrides:
endDocumentin classXMLEmitter- Throws:
XPathException- if an error occurs
-
close
public void close() throws XPathExceptionDescription copied from class:XMLEmitterEnd of the document.- Specified by:
closein interfaceReceiver- Overrides:
closein classXMLEmitter- Throws:
XPathException- if an error occurs
-
-