## Xalan-C++ API Documentation

### The Xalan C++ XSLT Processor Version 1.7

Main Page Class Hierarchy Alphabetical List Compound List File List Compound Members File Members

# FormatterListener Class Reference

A SAX-based formatter interface for the XSL processor. More...

`#include <FormatterListener.hpp>`

Inheritance diagram for FormatterListener

Collaboration diagram for FormatterListener:

List of all members.

## Public Types

- typedef XERCES_CPP_NAMESPACE_QUALIFIER
  DocumentHandler ParentType
- typedef unsigned int size_type
- 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
  }

## Public Methods

- FormatterListener (eFormat theFormat)
- virtual ~FormatterListener ()
- eFormat getOutputFormat () const
- const PrefixResolver* getPrefixResolver () const
    Get the PrefixResolver for the FormatterListener. More...
- void setPrefixResolver (const PrefixResolver* thePrefixResolver)
    Set the PrefixResolver for the FormatterListener. More...
- virtual void charactersRaw ( const XMLCh* const chars, const size_type length) = 0
    Receive notification of character data. More...
- virtual void comment (const XMLCh* const data) = 0
    Called when a Comment is to be constructed. More...
- virtual void cdata ( const XMLCh* const ch, const size_type length) = 0
    Receive notification of cdata. More...
- virtual void entityReference (const XMLCh* const name) = 0
    Receive notification of a entityReference. More...
- virtual void characters ( const XMLCh* const chars, const size_type length) = 0
- virtual void endDocument () = 0
- virtual void endElement (const XMLCh* const name) = 0
- virtual void ignorableWhitespace ( const XMLCh* const chars, const size_type length) = 0
- virtual void processingInstruction ( const XMLCh* const target, const XMLCh* const data) = 0
- virtual void resetDocument () = 0
- virtual void setDocumentLocator (const LocatorType* const locator) = 0
- virtual void startDocument () = 0
- virtual void startElement ( const XMLCh* const name, AttributeListType& attrs) = 0
- virtual Writer* getWriter () const
- virtual const XalanDOMString& getDoctypeSystem () const
- virtual const XalanDOMString& getDoctypePublic () const
- virtual const XalanDOMString& getEncoding () const
- virtual const XalanDOMString& getMediaType () const
- virtual int getIndent () const

## Static Public Attributes

- const XalanDOMChar s_piTarget []
- const XalanDOMChar s_piData []
- const XalanDOMString::size_type s_piTargetLength
- const XalanDOMString::size_type s_piDataLength

## Protected Attributes

- const PrefixResolver* m_prefixResolver

## Static Protected Attributes

- const XalanDOMString s_emptyString

## Detailed Description

A SAX-based formatter interface for the XSL processor.

This interface will be called as result tree elements are constructed.

## Member Typedef Documentation

typedef XERCES_CPP_NAMESPACE_QUALIFIER DocumentHandler FormatterListener::ParentType

typedef unsigned int FormatterListener::size_type

Reimplemented in FormatterStringLengthCounter.

## Member Enumeration Documentation

enum FormatterListener::eFormat

Enumeration values:

  OUTPUT_METHOD_NONE |
  OUTPUT_METHOD_XML |
  OUTPUT_METHOD_HTML |
  OUTPUT_METHOD_TEXT |
  OUTPUT_METHOD_DOM |
  OUTPUT_METHOD_OTHER |

## Constructor & Destructor Documentation

FormatterListener::FormatterListener ( | eFormat theFormat )

virtual FormatterListener::~FormatterListener ( | )`[virtual]`

## Member Function Documentation

void FormatterListener::cdata ( | const XMLCh *const ch,
| const size_type length )`[pure 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:

  ch | pointer to characters from the XML document
  length | number of characters to read from the array

Exceptions:

  SAXException |

virtual void FormatterListener::characters ( | const XMLCh *const chars,
| const size_type length )`[pure virtual]`

void FormatterListener::charactersRaw ( | const XMLCh *const chars,
| const size_type length )`[pure virtual]`

Receive notification of character data.

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

Parameters:

  chars | pointer to characters from the XML document
  length | number of characters to read from the array

Exceptions:

  SAXException |

void FormatterListener::comment ( | const XMLCh *const data )`[pure virtual]`

Called when a Comment is to be constructed.

Parameters:

  data | pointer to comment data

Exceptions:

  SAXException |

Reimplemented in FormatterStringLengthCounter, FormatterToDOM, FormatterToDeprecatedXercesDOM, FormatterToNull, FormatterToSourceTree, FormatterToText, FormatterToXML, FormatterToXMLBase, FormatterToXML_UTF16, FormatterToXML_UTF8, FormatterToXercesDOM, and StylesheetHandler.

virtual void FormatterListener::endDocument ( | )`[pure virtual]`

Reimplemented in FormatterStringLengthCounter, FormatterToDOM, FormatterToDeprecatedXercesDOM, FormatterToHTML, FormatterToNull, FormatterToSourceTree, FormatterToText, FormatterToXML, FormatterToXMLBase, FormatterToXercesDOM, and StylesheetHandler.

virtual void FormatterListener::endElement ( | const XMLCh *const name )`[pure virtual]`

Reimplemented in FormatterStringLengthCounter, FormatterToDOM, FormatterToDeprecatedXercesDOM, FormatterToHTML, FormatterToNull, FormatterToSourceTree, FormatterToText, FormatterToXML, FormatterToXMLBase, FormatterToXML_UTF16, FormatterToXML_UTF8, FormatterToXercesDOM, and StylesheetHandler.

void FormatterListener::entityReference ( | const XMLCh *const data )`[pure virtual]`

Receive notification of a entityReference.

Parameters:

  data | pointer to characters from the XML document

Exceptions:

  SAXException |

Reimplemented in FormatterStringLengthCounter, FormatterToDOM, FormatterToDeprecatedXercesDOM, FormatterToHTML, FormatterToNull, FormatterToSourceTree, FormatterToText, FormatterToXML, FormatterToXMLBase, FormatterToXML_UTF16, FormatterToXML_UTF8, FormatterToXercesDOM, and StylesheetHandler.

virtual const XalanDOMString& FormatterListener::getDoctypePublic ( | ) const`[virtual]`

Reimplemented in FormatterToXML, and FormatterToXMLBase.

virtual const XalanDOMString& FormatterListener::getDoctypeSystem ( | ) const`[virtual]`

Reimplemented in FormatterToXML, and FormatterToXMLBase.

virtual const XalanDOMString& FormatterListener::getEncoding ( | ) const`[virtual]`

Reimplemented in FormatterToText, FormatterToXML, FormatterToXMLBase, FormatterToXML_UTF16, and FormatterToXML_UTF8.

virtual int FormatterListener::getIndent ( | ) const`[virtual]`

Reimplemented in FormatterToXML.

virtual const XalanDOMString& FormatterListener::getMediaType ( | ) const`[virtual]`

Reimplemented in FormatterToXML, and FormatterToXMLBase.

eFormat FormatterListener::getOutputFormat ( | ) const`[]`

const PrefixResolver * FormatterListener::getPrefixResolver ( | ) const`[]`

Get the PrefixResolver for the FormatterListener.

Returns:
  A pointer to the PrefixResolver, if any.

virtual Writer* FormatterListener::getWriter ( | ) const`[virtual]`

Reimplemented in FormatterToText, FormatterToXML, and FormatterToXMLBase.

virtual void FormatterListener::ignorableWhitespace ( | const XMLCh *const chars,
| const size_type length )`[pure virtual]`

virtual void FormatterListener::processingInstruction ( | const XMLCh *const target,
| const XMLCh *const data )`[pure virtual]`

Reimplemented in FormatterStringLengthCounter, FormatterToDOM, FormatterToDeprecatedXercesDOM, FormatterToHTML, FormatterToNull, FormatterToSourceTree, FormatterToText, FormatterToXML, FormatterToXMLBase, FormatterToXercesDOM, and StylesheetHandler.

virtual void FormatterListener::resetDocument ( | )`[pure virtual]`

Reimplemented in FormatterStringLengthCounter, FormatterToDOM, FormatterToDeprecatedXercesDOM, FormatterToNull, FormatterToSourceTree, FormatterToText, FormatterToXML, FormatterToXMLBase, FormatterToXercesDOM, and StylesheetHandler.

virtual void FormatterListener::setDocumentLocator ( | const LocatorType *const locator )`[pure virtual]`

Reimplemented in FormatterStringLengthCounter, FormatterToDOM, FormatterToDeprecatedXercesDOM, FormatterToNull, FormatterToSourceTree, FormatterToText, FormatterToXML, FormatterToXMLBase, FormatterToXercesDOM, and StylesheetHandler.

void FormatterListener::setPrefixResolver ( | const PrefixResolver * thePrefixResolver )`[]`

Set the PrefixResolver for the FormatterListener.

Parameters:

  thePrefixResolver | A pointer to the PrefixResolver, if any.

virtual void FormatterListener::startDocument ( | )`[pure virtual]`

Reimplemented in FormatterStringLengthCounter, FormatterToDOM, FormatterToDeprecatedXercesDOM, FormatterToHTML, FormatterToNull, FormatterToSourceTree, FormatterToText, FormatterToXML, FormatterToXMLBase, FormatterToXercesDOM, and StylesheetHandler.

virtual void FormatterListener::startElement ( | const XMLCh *const name,
| AttributeListType & attrs )`[pure virtual]`

Reimplemented in FormatterStringLengthCounter, FormatterToDOM, FormatterToDeprecatedXercesDOM, FormatterToHTML, FormatterToNull, FormatterToSourceTree, FormatterToText, FormatterToXML, FormatterToXMLBase, FormatterToXML_UTF16, FormatterToXML_UTF8, FormatterToXercesDOM, and StylesheetHandler.

## Member Data Documentation

const PrefixResolver * FormatterListener::m_prefixResolver`[protected]`

const XalanDOMString FormatterListener::s_emptyString`[static, protected]`

const XalanDOMChar FormatterListener::s_piData[]`[static]`

const XalanDOMString::size_type FormatterListener::s_piDataLength`[static]`

const XalanDOMChar FormatterListener::s_piTarget[]`[static]`

const XalanDOMString::size_type FormatterListener::s_piTargetLength`[static]`

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

- FormatterListener.hpp

Interpreting class diagrams

Doxygen and GraphViz are used to generate this API documentation from the Xalan-C header files.

Xalan-C++ XSLT Processor Version 1.7 Copyright © 1999-2004 The Apache Software Foundation. All Rights Reserved.