Xalan-C++ API Reference  1.12.0
Public Member Functions | Static Public Member Functions | List of all members
xalanc::FormatterToText Class Reference

This class takes SAX events (in addition to some extra events that SAX doesn't handle yet) and produces simple text only. More...

#include <xalanc/XMLSupport/FormatterToText.hpp>

Inheritance diagram for xalanc::FormatterToText:
[legend]
Collaboration diagram for xalanc::FormatterToText:
[legend]

Public Member Functions

 FormatterToText (MemoryManager &theManager XALAN_DEFAULT_CONSTRUCTOR_MEMMGR)
 FormatterToText instance constructor. More...
 
 FormatterToText (Writer &writer, bool normalizeLinefeed=true, bool handleIgnorableWhitespace=true, MemoryManager &theManager XALAN_DEFAULT_MEMMGR)
 FormatterToText instance constructor. More...
 
 FormatterToText (Writer &writer, const XalanDOMString &encoding, bool normalizeLinefeed=true, bool handleIgnorableWhitespace=true, MemoryManager &theManager XALAN_DEFAULT_MEMMGR)
 FormatterToText instance constructor. More...
 
virtual ~FormatterToText ()
 
MemoryManager & getMemoryManager ()
 
WritergetWriter () const
 
void setWriter (Writer *theWriter)
 
void clearEncoding ()
 
const XalanDOMStringgetEncoding () const
 
void setEncoding (const XalanDOMString &theEncoding)
 
XalanDOMChar getMaxCharacter () const
 
void setMaxCharacter (XalanDOMChar theMaxChar)
 
bool getNormalizeLinefeed () const
 
void setNormalizeLinefeed (bool fNormalize)
 
bool getHandleIgnorableWhitespace () const
 
void setHandleIgnorableWhitespace (bool fHandle)
 
virtual void setDocumentLocator (const Locator *const locator)
 
virtual void startDocument ()
 
virtual void endDocument ()
 
virtual void startElement (const XMLCh *const name, AttributeListType &attrs)
 
virtual void endElement (const XMLCh *const name)
 
virtual void characters (const XMLCh *const chars, const size_type length)
 
virtual void charactersRaw (const XMLCh *const chars, const size_type length)
 Receive notification of character data. More...
 
virtual void entityReference (const XMLCh *const name)
 Receive notification of a entityReference. More...
 
virtual void ignorableWhitespace (const XMLCh *const chars, const size_type length)
 
virtual void processingInstruction (const XMLCh *const target, const XMLCh *const data)
 
virtual void resetDocument ()
 
virtual void comment (const XMLCh *const data)
 Called when a Comment is to be constructed. More...
 
virtual void cdata (const XMLCh *const ch, const size_type length)
 Receive notification of cdata. More...
 
- Public Member Functions inherited from xalanc::FormatterListener
 FormatterListener (eFormat theFormat)
 
virtual ~FormatterListener ()
 
eFormat getOutputFormat () const
 Get the output format for the instance. More...
 
eXMLVersion getXMLVersion () const
 Get the version of XML the FormatterListener is generating. More...
 
bool isXML1_1Version () const
 Determine if the version of XML output is 1.1. More...
 
const PrefixResolvergetPrefixResolver () const
 Get the PrefixResolver for the FormatterListener. More...
 
void setPrefixResolver (const PrefixResolver *thePrefixResolver)
 Set the PrefixResolver for the FormatterListener. More...
 
virtual void startElement (const XMLCh *const name, AttributeList &attrs)=0
 
virtual const XalanDOMStringgetDoctypeSystem () const
 
virtual const XalanDOMStringgetDoctypePublic () const
 
virtual const XalanDOMStringgetMediaType () const
 
virtual int getIndent () const
 

Static Public Member Functions

static FormatterToTextcreate (MemoryManager &theManager, Writer &writer, const XalanDOMString &encoding, bool normalizeLinefeed=true, bool handleIgnorableWhitespace=true)
 

Additional Inherited Members

- Public Types inherited from xalanc::FormatterListener
enum  eFormat {
  OUTPUT_METHOD_NONE = 0, OUTPUT_METHOD_XML = 1, OUTPUT_METHOD_HTML = 2, OUTPUT_METHOD_TEXT = 3,
  OUTPUT_METHOD_DOM = 4, OUTPUT_METHOD_OTHER = 5
}
 
enum  eXMLVersion { XML_VERSION_1_0 = 0, XML_VERSION_1_1 = 1 }
 
typedef xercesc::DocumentHandler ParentType
 
typedef XalanSize_t size_type
 
- Static Public Attributes inherited from xalanc::FormatterListener
static const XalanDOMChar s_piTarget []
 
static const XalanDOMChar s_piData []
 
static const XalanDOMString::size_type s_piTargetLength
 
static const XalanDOMString::size_type s_piDataLength
 
- Protected Member Functions inherited from xalanc::FormatterListener
void setXMLVersion (eXMLVersion theVersion)
 Set the output version during serializing. More...
 
- Protected Attributes inherited from xalanc::FormatterListener
const PrefixResolverm_prefixResolver
 
- Static Protected Attributes inherited from xalanc::FormatterListener
static const XalanDOMString s_emptyString
 

Detailed Description

This class takes SAX events (in addition to some extra events that SAX doesn't handle yet) and produces simple text only.

Definition at line 49 of file FormatterToText.hpp.

Constructor & Destructor Documentation

◆ FormatterToText() [1/3]

xalanc::FormatterToText::FormatterToText ( MemoryManager &theManager  XALAN_DEFAULT_CONSTRUCTOR_MEMMGR)

FormatterToText instance constructor.

◆ FormatterToText() [2/3]

xalanc::FormatterToText::FormatterToText ( Writer writer,
bool  normalizeLinefeed = true,
bool  handleIgnorableWhitespace = true,
MemoryManager &theManager  XALAN_DEFAULT_MEMMGR 
)

FormatterToText instance constructor.

Parameters
writerwriter for output
normalizeLindefeedNormalize
or \r
(on certain platforms).
handleIgnorableWhitespaceIf true ignorableWhitespace() will write data to the Writer

◆ FormatterToText() [3/3]

xalanc::FormatterToText::FormatterToText ( Writer writer,
const XalanDOMString encoding,
bool  normalizeLinefeed = true,
bool  handleIgnorableWhitespace = true,
MemoryManager &theManager  XALAN_DEFAULT_MEMMGR 
)

FormatterToText instance constructor.

Parameters
writerwriter for output
encodingcharacter encoding for the writer
normalizeLindefeedNormalize
or \r
on certain platforms.
handleIgnorableWhitespaceIf true ignorableWhitespace() will write data to the Writer

◆ ~FormatterToText()

virtual xalanc::FormatterToText::~FormatterToText ( )
virtual

Member Function Documentation

◆ cdata()

virtual void xalanc::FormatterToText::cdata ( const XMLCh *const  ch,
const size_type  length 
)
virtual

Receive notification of cdata.

The Parser will call this method to report each chunk of character data. SAX parsers may return all contiguous character data in a single chunk, or they may split it into several chunks; however, all of the characters in any single event must come from the same external entity, so that the Locator provides useful information.

The application must not attempt to read from the array outside of the specified range.

Note that some parsers will report whitespace using the ignorableWhitespace() method rather than this one (validating parsers must do so).

Parameters
chpointer to characters from the XML document
lengthnumber of characters to read from the array
Exceptions
SAXException

Implements xalanc::FormatterListener.

◆ characters()

virtual void xalanc::FormatterToText::characters ( const XMLCh *const  chars,
const size_type  length 
)
virtual

◆ charactersRaw()

virtual void xalanc::FormatterToText::charactersRaw ( const XMLCh *const  chars,
const size_type  length 
)
virtual

Receive notification of character data.

If available, when the disable-output-escaping attribute is used, output raw text without escaping.

Parameters
charspointer to characters from the XML document
lengthnumber of characters to read from the array
Exceptions
SAXException

Implements xalanc::FormatterListener.

◆ clearEncoding()

void xalanc::FormatterToText::clearEncoding ( )

◆ comment()

virtual void xalanc::FormatterToText::comment ( const XMLCh *const  data)
virtual

Called when a Comment is to be constructed.

Parameters
datapointer to comment data
Exceptions
SAXException

Implements xalanc::FormatterListener.

◆ create()

static FormatterToText* xalanc::FormatterToText::create ( MemoryManager &  theManager,
Writer writer,
const XalanDOMString encoding,
bool  normalizeLinefeed = true,
bool  handleIgnorableWhitespace = true 
)
static

◆ endDocument()

virtual void xalanc::FormatterToText::endDocument ( )
virtual

◆ endElement()

virtual void xalanc::FormatterToText::endElement ( const XMLCh *const  name)
virtual

◆ entityReference()

virtual void xalanc::FormatterToText::entityReference ( const XMLCh *const  name)
virtual

Receive notification of a entityReference.

Parameters
datapointer to characters from the XML document
Exceptions
SAXException

Implements xalanc::FormatterListener.

◆ getEncoding()

const XalanDOMString& xalanc::FormatterToText::getEncoding ( ) const
inlinevirtual

Reimplemented from xalanc::FormatterListener.

Definition at line 121 of file FormatterToText.hpp.

◆ getHandleIgnorableWhitespace()

bool xalanc::FormatterToText::getHandleIgnorableWhitespace ( ) const
inline

Definition at line 159 of file FormatterToText.hpp.

◆ getMaxCharacter()

XalanDOMChar xalanc::FormatterToText::getMaxCharacter ( ) const
inline

Definition at line 135 of file FormatterToText.hpp.

◆ getMemoryManager()

MemoryManager& xalanc::FormatterToText::getMemoryManager ( )
inline

Definition at line 98 of file FormatterToText.hpp.

◆ getNormalizeLinefeed()

bool xalanc::FormatterToText::getNormalizeLinefeed ( ) const
inline

Definition at line 147 of file FormatterToText.hpp.

◆ getWriter()

Writer* xalanc::FormatterToText::getWriter ( ) const
inlinevirtual

Reimplemented from xalanc::FormatterListener.

Definition at line 104 of file FormatterToText.hpp.

◆ ignorableWhitespace()

virtual void xalanc::FormatterToText::ignorableWhitespace ( const XMLCh *const  chars,
const size_type  length 
)
virtual

◆ processingInstruction()

virtual void xalanc::FormatterToText::processingInstruction ( const XMLCh *const  target,
const XMLCh *const  data 
)
virtual

◆ resetDocument()

virtual void xalanc::FormatterToText::resetDocument ( )
virtual

◆ setDocumentLocator()

virtual void xalanc::FormatterToText::setDocumentLocator ( const Locator *const  locator)
virtual

◆ setEncoding()

void xalanc::FormatterToText::setEncoding ( const XalanDOMString theEncoding)
inline

Definition at line 127 of file FormatterToText.hpp.

◆ setHandleIgnorableWhitespace()

void xalanc::FormatterToText::setHandleIgnorableWhitespace ( bool  fHandle)
inline

Definition at line 165 of file FormatterToText.hpp.

◆ setMaxCharacter()

void xalanc::FormatterToText::setMaxCharacter ( XalanDOMChar  theMaxChar)
inline

Definition at line 141 of file FormatterToText.hpp.

◆ setNormalizeLinefeed()

void xalanc::FormatterToText::setNormalizeLinefeed ( bool  fNormalize)
inline

Definition at line 153 of file FormatterToText.hpp.

◆ setWriter()

void xalanc::FormatterToText::setWriter ( Writer theWriter)
inline

Definition at line 110 of file FormatterToText.hpp.

◆ startDocument()

virtual void xalanc::FormatterToText::startDocument ( )
virtual

◆ startElement()

virtual void xalanc::FormatterToText::startElement ( const XMLCh *const  name,
AttributeListType attrs 
)
virtual

The documentation for this class was generated from the following file: