net.sf.saxon.event

Class HTMLIndenter

public class HTMLIndenter extends ProxyReceiver

HTMLIndenter: This ProxyEmitter indents HTML elements, by adding whitespace character data where appropriate. The character data is never added when within an inline element. The string used for indentation defaults to three spaces, but may be set using the indent-chars property

Author: Michael Kay

Field Summary
protected static String[]formattedTags
protected static String[]inlineTags
protected static intIS_FORMATTED
protected static intIS_INLINE
Constructor Summary
HTMLIndenter()
Method Summary
voidcharacters(CharSequence chars, int locationId, int properties)
Output character data
protected intclassifyTag(int nameCode)
Classify an element name as inline, formatted, or both or neither.
voidcomment(CharSequence chars, int locationId, int properties)
Output a comment
voidendElement()
Output element end tag
voidsetOutputProperties(Properties props)
Set the properties for this indenter
voidstartElement(int nameCode, int typeCode, int locationId, int properties)
Output element start tag

Field Detail

formattedTags

protected static String[] formattedTags

inlineTags

protected static String[] inlineTags

IS_FORMATTED

protected static final int IS_FORMATTED

IS_INLINE

protected static final int IS_INLINE

Constructor Detail

HTMLIndenter

public HTMLIndenter()

Method Detail

characters

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

classifyTag

protected int classifyTag(int nameCode)
Classify an element name as inline, formatted, or both or neither. This method is overridden in the XHTML indenter

Parameters: nameCode the element name

Returns: a bit-significant integer containing flags IS_INLINE and/or IS_FORMATTED

comment

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

endElement

public void endElement()
Output element end tag

setOutputProperties

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

startElement

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