Xalan-C++ API Reference  1.12.0
Public Types | Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
xalanc::FormatterListener Class Referenceabstract

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

#include <xalanc/PlatformSupport/FormatterListener.hpp>

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

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 xercesc::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 xercesc::DocumentHandler xalanc::FormatterListener::ParentType

Definition at line 60 of file FormatterListener.hpp.

◆ 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()

xalanc::FormatterListener::FormatterListener ( eFormat  theFormat)

◆ ~FormatterListener()

virtual xalanc::FormatterListener::~FormatterListener ( )
virtual

Member Function Documentation

◆ cdata()

virtual void xalanc::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 xalanc::FormatterToText, xalanc::StylesheetHandler, xalanc::FormatterToSourceTree, xalanc::FormatterStringLengthCounter, xalanc::FormatterToNull, and xalanc::FormatterToXercesDOM.

◆ characters()

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

◆ charactersRaw()

virtual void xalanc::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 xalanc::FormatterToXMLUnicode< UnicodeWriter, ConstantsType, CharPredicate, IndentHandler, XMLVersion >, xalanc::FormatterToText, xalanc::StylesheetHandler, xalanc::FormatterToSourceTree, xalanc::FormatterToXercesDOM, xalanc::FormatterStringLengthCounter, and xalanc::FormatterToNull.

◆ comment()

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

◆ endDocument()

virtual void xalanc::FormatterListener::endDocument ( )
pure virtual

◆ endElement()

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

◆ entityReference()

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

◆ getDoctypePublic()

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

◆ getDoctypeSystem()

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

◆ getEncoding()

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

◆ getIndent()

virtual int xalanc::FormatterListener::getIndent ( ) const
virtual

Reimplemented in xalanc::FormatterToXML.

◆ getMediaType()

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

Reimplemented in xalanc::FormatterToXML.

◆ getOutputFormat()

eFormat xalanc::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* xalanc::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* xalanc::FormatterListener::getWriter ( ) const
virtual

◆ getXMLVersion()

eXMLVersion xalanc::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 xalanc::FormatterListener::ignorableWhitespace ( const XMLCh *const  chars,
const size_type  length 
)
pure virtual

◆ isXML1_1Version()

bool xalanc::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 xalanc::FormatterListener::processingInstruction ( const XMLCh *const  target,
const XMLCh *const  data 
)
pure virtual

◆ resetDocument()

virtual void xalanc::FormatterListener::resetDocument ( )
pure virtual

◆ setDocumentLocator()

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

◆ setPrefixResolver()

void xalanc::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 xalanc::FormatterListener::setXMLVersion ( eXMLVersion  theVersion)
inlineprotected

Set the output version during serializing.

Parameters
theVersionXML version of the output

Definition at line 280 of file FormatterListener.hpp.

◆ startDocument()

virtual void xalanc::FormatterListener::startDocument ( )
pure virtual

◆ startElement()

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

Member Data Documentation

◆ m_prefixResolver

const PrefixResolver* xalanc::FormatterListener::m_prefixResolver
protected

Definition at line 270 of file FormatterListener.hpp.

◆ s_emptyString

const XalanDOMString xalanc::FormatterListener::s_emptyString
staticprotected

Definition at line 272 of file FormatterListener.hpp.

◆ s_piData

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

Definition at line 261 of file FormatterListener.hpp.

◆ s_piDataLength

const XalanDOMString::size_type xalanc::FormatterListener::s_piDataLength
static

Definition at line 264 of file FormatterListener.hpp.

◆ s_piTarget

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

Definition at line 259 of file FormatterListener.hpp.

◆ s_piTargetLength

const XalanDOMString::size_type xalanc::FormatterListener::s_piTargetLength
static

Definition at line 263 of file FormatterListener.hpp.


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