net.sf.saxon.event

Class XMLIndenter

Implemented Interfaces:
Receiver, Result

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

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

XMLIndenter()
Create an XML Indenter

Method Summary

void
attribute(int nameCode, int typeCode, CharSequence value, int locationId, int properties)
Output an attribute
void
characters(CharSequence chars, int locationId, int properties)
Output character data
void
comment(CharSequence chars, int locationId, int properties)
Output a comment
void
endElement()
Output element end tag
void
open()
Start of document
void
processingInstruction(String target, CharSequence data, int locationId, int properties)
Output a processing instruction
void
setOutputProperties(Properties props)
Set the properties for this indenter
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

XMLIndenter

public XMLIndenter()
Create an XML Indenter

Method Details

attribute

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

characters

public void characters(CharSequence chars,
                       int locationId,
                       int properties)
            throws XPathException
Output character data
Specified by:
characters in interface Receiver
Overrides:
characters in interface ProxyReceiver

comment

public void comment(CharSequence chars,
                    int locationId,
                    int properties)
            throws XPathException
Output a comment
Specified by:
comment in interface Receiver
Overrides:
comment in interface ProxyReceiver

endElement

public void endElement()
            throws XPathException
Output element end tag
Specified by:
endElement in interface Receiver
Overrides:
endElement in interface ProxyReceiver

open

public void open()
            throws XPathException
Start of document
Specified by:
open in interface Receiver
Overrides:
open in interface ProxyReceiver

processingInstruction

public void processingInstruction(String target,
                                  CharSequence data,
                                  int locationId,
                                  int properties)
            throws XPathException
Output a processing instruction
Specified by:
processingInstruction in interface Receiver
Overrides:
processingInstruction in interface ProxyReceiver

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)
            throws XPathException
Output element start tag
Specified by:
startElement in interface Receiver
Overrides:
startElement in interface ProxyReceiver