Xalan-C++ API Documentation

The Xalan C++ XSLT Processor Version 1.11


Public Types | Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
FormatterListener Class Referenceabstract

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

#include <FormatterListener.hpp>

Inherits XERCES_CPP_NAMESPACE_QUALIFIER DocumentHandler.

Inherited by FormatterStringLengthCounter, FormatterToDeprecatedXercesDOM, FormatterToNull, FormatterToSourceTree, FormatterToText, FormatterToXercesDOM, FormatterToXML, StylesheetHandler, and XalanXMLSerializerBase.

Public Types

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 XERCES_CPP_NAMESPACE_QUALIFIER DocumentHandler ParentType
 
typedef XalanSize_t size_type
 

Public Member Functions

 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 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 Locator *const locator)=0
 
virtual void startDocument ()=0
 
virtual void startElement (const XMLCh *const name, AttributeList &attrs)=0
 
virtual WritergetWriter () const
 
virtual const XalanDOMStringgetDoctypeSystem () const
 
virtual const XalanDOMStringgetDoctypePublic () const
 
virtual const XalanDOMStringgetEncoding () const
 
virtual const XalanDOMStringgetMediaType () const
 
virtual int getIndent () const
 

Static Public Attributes

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

void setXMLVersion (eXMLVersion theVersion)
 Set the output version during serializing. More...
 

Protected Attributes

const PrefixResolverm_prefixResolver
 

Static Protected Attributes

static 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.

Definition at line 56 of file FormatterListener.hpp.

Member Typedef Documentation

◆ ParentType

typedef XERCES_CPP_NAMESPACE_QUALIFIER DocumentHandler FormatterListener::ParentType

Definition at line 60 of file FormatterListener.hpp.

◆ size_type

typedef XalanSize_t FormatterListener::size_type

Definition at line 63 of file FormatterListener.hpp.

Member Enumeration Documentation

◆ eFormat

Enumerator
OUTPUT_METHOD_NONE 
OUTPUT_METHOD_XML 
OUTPUT_METHOD_HTML 
OUTPUT_METHOD_TEXT 
OUTPUT_METHOD_DOM 
OUTPUT_METHOD_OTHER 

Definition at line 65 of file FormatterListener.hpp.

◆ eXMLVersion

Enumerator
XML_VERSION_1_0 
XML_VERSION_1_1 

Definition at line 75 of file FormatterListener.hpp.

Constructor & Destructor Documentation

◆ FormatterListener()

FormatterListener::FormatterListener ( eFormat  theFormat)

◆ ~FormatterListener()

virtual FormatterListener::~FormatterListener ( )
virtual

Member Function Documentation

◆ cdata()

virtual 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
chpointer to characters from the XML document
lengthnumber of characters to read from the array
Exceptions
SAXException

Implemented in FormatterToText, FormatterToXML, StylesheetHandler, XalanXMLSerializerBase, FormatterToSourceTree, FormatterToHTML, FormatterStringLengthCounter, FormatterToNull, and FormatterToXercesDOM.

◆ characters()

virtual void FormatterListener::characters ( const XMLCh *const  chars,
const size_type  length 
)
pure virtual

◆ charactersRaw()

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
charspointer to characters from the XML document
lengthnumber of characters to read from the array
Exceptions
SAXException

Implemented in FormatterToXMLUnicode< UnicodeWriter, ConstantsType, CharPredicate, IndentHandler, XMLVersion >, FormatterToText, FormatterToXML, StylesheetHandler, FormatterToSourceTree, XalanXMLSerializerBase, FormatterToXercesDOM, FormatterStringLengthCounter, and FormatterToNull.

◆ comment()

virtual void FormatterListener::comment ( const XMLCh *const  data)
pure virtual

◆ endDocument()

virtual void FormatterListener::endDocument ( )
pure virtual

◆ endElement()

virtual void FormatterListener::endElement ( const XMLCh *const  name)
pure virtual

◆ entityReference()

virtual void FormatterListener::entityReference ( const XMLCh *const  name)
pure virtual

◆ getDoctypePublic()

virtual const XalanDOMString& FormatterListener::getDoctypePublic ( ) const
virtual

Reimplemented in FormatterToXML, and XalanXMLSerializerBase.

◆ getDoctypeSystem()

virtual const XalanDOMString& FormatterListener::getDoctypeSystem ( ) const
virtual

Reimplemented in FormatterToXML, and XalanXMLSerializerBase.

◆ getEncoding()

virtual const XalanDOMString& FormatterListener::getEncoding ( ) const
virtual

◆ getIndent()

virtual int FormatterListener::getIndent ( ) const
virtual

Reimplemented in FormatterToXML.

◆ getMediaType()

virtual const XalanDOMString& FormatterListener::getMediaType ( ) const
virtual

Reimplemented in FormatterToXML.

◆ getOutputFormat()

eFormat FormatterListener::getOutputFormat ( ) const
inline

Get the output format for the instance.

Returns
An enum indicating the output format.

Definition at line 92 of file FormatterListener.hpp.

◆ getPrefixResolver()

const PrefixResolver* FormatterListener::getPrefixResolver ( ) const
inline

Get the PrefixResolver for the FormatterListener.

Returns
A pointer to the PrefixResolver, if any.

Definition at line 126 of file FormatterListener.hpp.

◆ getWriter()

virtual Writer* FormatterListener::getWriter ( ) const
virtual

◆ getXMLVersion()

eXMLVersion FormatterListener::getXMLVersion ( ) const
inline

Get the version of XML the FormatterListener is generating.

Returns
An enum indication the XML version.

Definition at line 104 of file FormatterListener.hpp.

◆ ignorableWhitespace()

virtual void FormatterListener::ignorableWhitespace ( const XMLCh *const  chars,
const size_type  length 
)
pure virtual

◆ isXML1_1Version()

bool FormatterListener::isXML1_1Version ( ) const
inline

Determine if the version of XML output is 1.1.

Returns
true if the output version is 1.1, false if not.

Definition at line 115 of file FormatterListener.hpp.

◆ processingInstruction()

virtual void FormatterListener::processingInstruction ( const XMLCh *const  target,
const XMLCh *const  data 
)
pure virtual

◆ resetDocument()

virtual void FormatterListener::resetDocument ( )
pure virtual

◆ setDocumentLocator()

virtual void FormatterListener::setDocumentLocator ( const Locator *const  locator)
pure virtual

◆ setPrefixResolver()

void FormatterListener::setPrefixResolver ( const PrefixResolver thePrefixResolver)
inline

Set the PrefixResolver for the FormatterListener.

Parameters
thePrefixResolverA pointer to the PrefixResolver, if any.

Definition at line 137 of file FormatterListener.hpp.

◆ setXMLVersion()

void FormatterListener::setXMLVersion ( eXMLVersion  theVersion)
inlineprotected

Set the output version during serializing.

Parameters
theVersionXML version of the output

Definition at line 285 of file FormatterListener.hpp.

◆ startDocument()

virtual void FormatterListener::startDocument ( )
pure virtual

◆ startElement()

virtual void FormatterListener::startElement ( const XMLCh *const  name,
AttributeList &  attrs 
)
pure virtual

Member Data Documentation

◆ m_prefixResolver

const PrefixResolver* FormatterListener::m_prefixResolver
protected

Definition at line 275 of file FormatterListener.hpp.

◆ s_emptyString

const XalanDOMString FormatterListener::s_emptyString
staticprotected

Definition at line 277 of file FormatterListener.hpp.

◆ s_piData

const XalanDOMChar FormatterListener::s_piData[]
static

Definition at line 261 of file FormatterListener.hpp.

◆ s_piDataLength

const XalanDOMString::size_type FormatterListener::s_piDataLength
static

Definition at line 268 of file FormatterListener.hpp.

◆ s_piTarget

const XalanDOMChar FormatterListener::s_piTarget[]
static

Definition at line 259 of file FormatterListener.hpp.

◆ s_piTargetLength

const XalanDOMString::size_type FormatterListener::s_piTargetLength
static

Definition at line 267 of file FormatterListener.hpp.


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

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.11
Copyright © 1999-2012 The Apache Software Foundation.
All Rights Reserved.

Apache Logo