gnu.xml.pipeline

Class TextConsumer

public class TextConsumer extends XMLWriter implements EventConsumer

Terminates a pipeline, consuming events to print them as well formed XML (or XHTML) text.

Input must be well formed, and must include XML names (e.g. the prefixes and prefix declarations must be present), or the output of this class is undefined.

Version: $Date: 2001/10/23 17:42:25 $

Author: David Brownell

See Also: NSFilter

Constructor Summary
TextConsumer(Writer w, boolean isXhtml)
Constructs an event consumer which echoes its input as text, optionally adhering to some basic XHTML formatting options which increase interoperability with old (v3) browsers.
TextConsumer(Writer w)
Constructs a consumer that writes its input as XML text.
TextConsumer(OutputStream out)
Constructs a consumer that writes its input as XML text, encoded in UTF-8.
Method Summary
ContentHandlergetContentHandler()
EventConsumer Returns the document handler being used.
DTDHandlergetDTDHandler()
EventConsumer Returns the dtd handler being used.
ObjectgetProperty(String propertyId)
XMLReaderRetrieves a property (lexical and decl handlers)

Constructor Detail

TextConsumer

public TextConsumer(Writer w, boolean isXhtml)
Constructs an event consumer which echoes its input as text, optionally adhering to some basic XHTML formatting options which increase interoperability with old (v3) browsers.

For the best interoperability, when writing as XHTML only ASCII characters are emitted; other characters are turned to entity or character references as needed, and no XML declaration is provided in the document.

TextConsumer

public TextConsumer(Writer w)
Constructs a consumer that writes its input as XML text. XHTML rules are not followed.

TextConsumer

public TextConsumer(OutputStream out)
Constructs a consumer that writes its input as XML text, encoded in UTF-8. XHTML rules are not followed.

Method Detail

getContentHandler

public ContentHandler getContentHandler()
EventConsumer Returns the document handler being used.

getDTDHandler

public DTDHandler getDTDHandler()
EventConsumer Returns the dtd handler being used.

getProperty

public Object getProperty(String propertyId)
XMLReaderRetrieves a property (lexical and decl handlers)

Source code is under GPL (with library exception) in the JAXP project at http://www.gnu.org/software/classpathx/jaxp
This documentation was derived from that source code on 2013-01-12.