net.sf.saxon.event

Class XMLIndenter

public class XMLIndenter extends ProxyReceiver

XMLIndenter: This ProxyReceiver indents elements, by adding character data where appropriate. The character data is always added as "ignorable white space", that is, it is never added adjacent to existing character data.

Author: Michael Kay

Constructor Summary
XMLIndenter()
Create an XML Indenter
Method Summary
voidattribute(int nameCode, int typeCode, CharSequence value, int locationId, int properties)
Output an attribute
voidcharacters(CharSequence chars, int locationId, int properties)
Output character data
voidcomment(CharSequence chars, int locationId, int properties)
Output a comment
voidendElement()
Output element end tag
voidopen()
Start of document
voidprocessingInstruction(String target, CharSequence data, int locationId, int properties)
Output a processing instruction
voidsetOutputProperties(Properties props)
Set the properties for this indenter
voidstartElement(int nameCode, int typeCode, int locationId, int properties)
Output element start tag
booleanusesTypeAnnotations()
Ask whether this Receiver (or the downstream pipeline) makes any use of the type annotations supplied on element and attribute events

Constructor Detail

XMLIndenter

public XMLIndenter()
Create an XML Indenter

Method Detail

attribute

public void attribute(int nameCode, int typeCode, CharSequence value, int locationId, int properties)
Output an attribute

characters

public void characters(CharSequence chars, int locationId, int properties)
Output character data

comment

public void comment(CharSequence chars, int locationId, int properties)
Output a comment

endElement

public void endElement()
Output element end tag

open

public void open()
Start of document

processingInstruction

public void processingInstruction(String target, CharSequence data, int locationId, int properties)
Output a processing instruction

setOutputProperties

public void setOutputProperties(Properties props)
Set the properties for this indenter

Parameters: props the serialization properties

startElement

public void startElement(int nameCode, int typeCode, int locationId, int properties)
Output element start tag

usesTypeAnnotations

public boolean usesTypeAnnotations()
Ask whether this Receiver (or the downstream pipeline) makes any use of the type annotations supplied on element and attribute events

Returns: true if the Receiver makes any use of this information. If false, the caller may supply untyped nodes instead of supplying the type annotation