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

FormatterToXML formats SAX-style events into XML. More...

#include <xalanc/XMLSupport/FormatterToXML.hpp>

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

Public Types

enum  eDummy { eDefaultIndentAmount = 0 }
 
typedef XalanVector< bool > BoolStackType
 
typedef XalanVector< XalanDOMChar > DOMCharBufferType
 
typedef XalanVector< char > ByteBufferType
 
- 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
 

Public Member Functions

 FormatterToXML (Writer &writer, const XalanDOMString &version=XalanDOMString(XalanMemMgrs::getDummyMemMgr()), bool doIndent=false, int indent=eDefaultIndentAmount, const XalanDOMString &encoding=XalanDOMString(XalanMemMgrs::getDummyMemMgr()), const XalanDOMString &mediaType=XalanDOMString(XalanMemMgrs::getDummyMemMgr()), const XalanDOMString &doctypeSystem=XalanDOMString(XalanMemMgrs::getDummyMemMgr()), const XalanDOMString &doctypePublic=XalanDOMString(XalanMemMgrs::getDummyMemMgr()), bool xmlDecl=true, const XalanDOMString &standalone=XalanDOMString(XalanMemMgrs::getDummyMemMgr()), eFormat format=OUTPUT_METHOD_XML, bool fBufferData=true, MemoryManager &theManager XALAN_DEFAULT_MEMMGR)
 Constructor for customized encoding and doctype. More...
 
virtual ~FormatterToXML ()
 
MemoryManager & getMemoryManager ()
 
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)
 
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)
 
virtual WritergetWriter () const
 
virtual const XalanDOMStringgetDoctypeSystem () const
 
virtual const XalanDOMStringgetDoctypePublic () const
 
virtual const XalanDOMStringgetEncoding () const
 
virtual const XalanDOMStringgetMediaType () const
 
virtual int getIndent () const
 
const XalanDOMStringgetVersion () const
 
const XalanDOMStringgetStandalone () const
 
bool getShouldWriteXMLHeader () const
 
void setShouldWriteXMLHeader (bool b)
 
bool getStripCData () const
 
void setStripCData (bool b)
 
bool getEscapeCData () const
 
void setEscapeCData (bool b)
 
bool getDoIndent () const
 
void setDoIndent (bool value)
 
void setIndent (int value)
 
- 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 charactersRaw (const XMLCh *const chars, const size_type length)=0
 Receive notification of character data. More...
 
virtual void cdata (const XMLCh *const ch, const size_type length)=0
 Receive notification of cdata. More...
 
virtual void characters (const XMLCh *const chars, const size_type length)=0
 
virtual void ignorableWhitespace (const XMLCh *const chars, const size_type length)=0
 
virtual void startElement (const XMLCh *const name, AttributeList &attrs)=0
 

Static Public Member Functions

static FormatterToXMLcreate (MemoryManager &theManager, Writer &writer, const XalanDOMString &version=XalanDOMString(XalanMemMgrs::getDummyMemMgr()), bool doIndent=false, int indent=eDefaultIndentAmount, const XalanDOMString &encoding=XalanDOMString(XalanMemMgrs::getDummyMemMgr()), const XalanDOMString &mediaType=XalanDOMString(XalanMemMgrs::getDummyMemMgr()), const XalanDOMString &doctypeSystem=XalanDOMString(XalanMemMgrs::getDummyMemMgr()), const XalanDOMString &doctypePublic=XalanDOMString(XalanMemMgrs::getDummyMemMgr()), bool xmlDecl=true, const XalanDOMString &standalone=XalanDOMString(XalanMemMgrs::getDummyMemMgr()), eFormat format=OUTPUT_METHOD_XML, bool fBufferData=true)
 

Protected Types

enum  eDummyTwo { SPECIALSSIZE = 256 }
 
typedef void(FormatterToXML::* AccumCharFunctionType) (XalanDOMChar)
 
typedef void(FormatterToXML::* AccumStringFunctionType) (const XalanDOMChar *)
 
typedef void(FormatterToXML::* AccumDOMStringFunctionType) (const XalanDOMString &)
 
typedef void(FormatterToXML::* AccumArrayFunctionType) (const XalanDOMChar[], size_type, size_type)
 
typedef void(FormatterToXML::* FlushFunctionType) ()
 

Protected Member Functions

void outputLineSep ()
 Output a line break. More...
 
void accumName (XalanDOMChar ch)
 Append a wide character to the buffer. More...
 
void accumContent (XalanDOMChar ch)
 Append a wide character to the buffer. More...
 
void accumName (const XalanDOMChar *chars)
 Append a null-terminated array of wide characters to the buffer. More...
 
void accumContent (const XalanDOMChar *chars)
 Append a null-terminated array of wide characters to the buffer. More...
 
void accumName (const XalanDOMChar chars[], size_type start, size_type length)
 Append an array of wide character to the buffer. More...
 
void accumContent (const XalanDOMChar chars[], size_type start, size_type length)
 Append an array of wide character to the buffer. More...
 
void accumName (const XalanDOMString &str)
 Append a string to the buffer. More...
 
void accumContent (const XalanDOMString &str)
 Append a string to the buffer. More...
 
size_type accumDefaultEscape (XalanDOMChar ch, size_type i, const XalanDOMChar chars[], size_type len, bool escLF)
 Escape and accum a character. More...
 
virtual bool accumDefaultEntity (XalanDOMChar ch, bool escLF)
 Handle one of the default entities, return false if it is not a default entity. More...
 
void initAttrCharsMap ()
 Set the attribute characters what will require special mapping. More...
 
void initCharsMap ()
 Set the output characters what will require special mapping. More...
 
void flushChars ()
 Flush the char buffer. More...
 
void flushBytes ()
 Flush the byte buffer. More...
 
void flushWriter ()
 
void openElementForChildren ()
 
bool childNodesWereAdded ()
 
bool shouldIndent () const
 
void writeParentTagEnd ()
 Check to see if a parent's ">" has been written, and, if it has not, write it. More...
 
void indent (int n)
 Prints a newline character and n spaces. More...
 
virtual void writeNormalizedChars (const XalanDOMChar ch[], size_type start, size_type length, bool isCData)
 Write normalized characters to the writer. More...
 
void writeNumberedEntityReference (XalanUnicodeChar theNumber)
 Write a number into the buffer as an entity reference. More...
 
virtual void writeAttrString (const XalanDOMChar *theString, size_type theStringLength)
 Write an attribute string. More...
 
virtual void accumCommentData (const XalanDOMChar *data)
 Write the data for a comment. More...
 
- Protected Member Functions inherited from xalanc::FormatterListener
void setXMLVersion (eXMLVersion theVersion)
 Set the output version during serializing. More...
 

Static Protected Member Functions

static void throwInvalidUTF16SurrogateException (XalanDOMChar ch, MemoryManager &theManager)
 Throw an exception when an invalid surrogate is encountered. More...
 
static void throwInvalidUTF16SurrogateException (XalanDOMChar ch, XalanDOMChar next, MemoryManager &theManager)
 Throw an exception when an invalid surrogate is encountered. More...
 
static void throwInvalidCharacterException (XalanUnicodeChar ch, MemoryManager &theManager)
 Throw an exception when an invalid XML character is encountered. More...
 
static bool isUTF16Surrogate (XalanDOMChar ch)
 

Protected Attributes

Writer *const m_writer
 The writer where the XML will be written. More...
 
XalanOutputStream *const m_stream
 The stream where the XML will be written. More...
 
XalanDOMChar m_maxCharacter
 The maximum character size before we have to resort to escaping. More...
 
XalanDOMChar m_attrCharsMap [SPECIALSSIZE]
 
XalanDOMChar m_charsMap [SPECIALSSIZE]
 
bool m_shouldWriteXMLHeader
 If true, XML header should be written to output. More...
 
bool m_ispreserve
 State flag to tell if preservation of whitespace is important. More...
 
bool m_doIndent
 Flag to tell if indenting (pretty-printing) is on. More...
 
bool m_startNewLine
 Flag to signal that a newline should be added. More...
 
bool m_needToOutputDocTypeDecl
 Flag to tell that we need to add the doctype decl, which we can't do until the first element is encountered. More...
 
bool m_isprevtext
 State flag that tells if the previous node processed was text, so we can tell if we should preserve whitespace. More...
 
bool m_stripCData
 If true, cdata sections are simply stripped of their CDATA brackets, without escaping. More...
 
bool m_nextIsRaw
 Tell if the next text should be raw. More...
 
bool m_inCData
 Tells if we're in CData section. More...
 
bool m_encodingIsUTF
 Flag to quickly tell if the encoding is capable of full Unicode support. More...
 
const XalanDOMString m_doctypeSystem
 The System ID for the doc type. More...
 
const XalanDOMString m_doctypePublic
 The public ID for the doc type. More...
 
XalanDOMString m_encoding
 The character encoding. More...
 
int m_currentIndent
 Flag to keep track of the indent amount. More...
 
int m_indent
 Amount to indent. More...
 
BoolStackType m_preserves
 Stack to keep track of whether or not we need to preserve whitespace. More...
 
XalanDOMString m_stringBuffer
 
- Protected Attributes inherited from xalanc::FormatterListener
const PrefixResolverm_prefixResolver
 

Additional Inherited Members

- 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
 
- Static Protected Attributes inherited from xalanc::FormatterListener
static const XalanDOMString s_emptyString
 

Detailed Description

FormatterToXML formats SAX-style events into XML.

Definition at line 59 of file FormatterToXML.hpp.

Member Typedef Documentation

◆ AccumArrayFunctionType

typedef void(FormatterToXML::* xalanc::FormatterToXML::AccumArrayFunctionType) (const XalanDOMChar[], size_type, size_type)
protected

Definition at line 297 of file FormatterToXML.hpp.

◆ AccumCharFunctionType

typedef void(FormatterToXML::* xalanc::FormatterToXML::AccumCharFunctionType) (XalanDOMChar)
protected

Definition at line 291 of file FormatterToXML.hpp.

◆ AccumDOMStringFunctionType

typedef void(FormatterToXML::* xalanc::FormatterToXML::AccumDOMStringFunctionType) (const XalanDOMString &)
protected

Definition at line 295 of file FormatterToXML.hpp.

◆ AccumStringFunctionType

typedef void(FormatterToXML::* xalanc::FormatterToXML::AccumStringFunctionType) (const XalanDOMChar *)
protected

Definition at line 293 of file FormatterToXML.hpp.

◆ BoolStackType

Definition at line 268 of file FormatterToXML.hpp.

◆ ByteBufferType

Definition at line 270 of file FormatterToXML.hpp.

◆ DOMCharBufferType

Definition at line 269 of file FormatterToXML.hpp.

◆ FlushFunctionType

typedef void(FormatterToXML::* xalanc::FormatterToXML::FlushFunctionType) ()
protected

Definition at line 302 of file FormatterToXML.hpp.

Member Enumeration Documentation

◆ eDummy

Enumerator
eDefaultIndentAmount 

Definition at line 63 of file FormatterToXML.hpp.

◆ eDummyTwo

Enumerator
SPECIALSSIZE 

Definition at line 591 of file FormatterToXML.hpp.

Constructor & Destructor Documentation

◆ FormatterToXML()

xalanc::FormatterToXML::FormatterToXML ( Writer writer,
const XalanDOMString version = XalanDOMString(XalanMemMgrs::getDummyMemMgr()),
bool  doIndent = false,
int  indent = eDefaultIndentAmount,
const XalanDOMString encoding = XalanDOMString(XalanMemMgrs::getDummyMemMgr()),
const XalanDOMString mediaType = XalanDOMString(XalanMemMgrs::getDummyMemMgr()),
const XalanDOMString doctypeSystem = XalanDOMString(XalanMemMgrs::getDummyMemMgr()),
const XalanDOMString doctypePublic = XalanDOMString(XalanMemMgrs::getDummyMemMgr()),
bool  xmlDecl = true,
const XalanDOMString standalone = XalanDOMString(XalanMemMgrs::getDummyMemMgr()),
eFormat  format = OUTPUT_METHOD_XML,
bool  fBufferData = true,
MemoryManager &theManager  XALAN_DEFAULT_MEMMGR 
)

Constructor for customized encoding and doctype.

Parameters
writercharacter output stream to use
versionversion of the output method
doIndenttrue if output is to be indented
indentnumber of spaces to indent at each nesting level
encodingcharacter encoding in use by writer
mediaTypemedia type (MIME content type) of the data
doctypeSystemsystem identifier to be used in the document type declaration
doctypePublicpublic identifier to be used in the document type declaration
xmlDecltrue if the XSLT processor should output an XML declaration
standalonetrue if the XSLT processor should output a standalone document declaration
formatshould be used only by derived classes.
fBufferDataIf true, data will be buffered in the formatter

◆ ~FormatterToXML()

virtual xalanc::FormatterToXML::~FormatterToXML ( )
virtual

Member Function Documentation

◆ accumCommentData()

virtual void xalanc::FormatterToXML::accumCommentData ( const XalanDOMChar *  data)
protectedvirtual

Write the data for a comment.

Parameters
dataThe comment's data.

Reimplemented in xalanc::FormatterToHTML.

◆ accumContent() [1/4]

void xalanc::FormatterToXML::accumContent ( const XalanDOMChar *  chars)
inlineprotected

Append a null-terminated array of wide characters to the buffer.

@chars the array to append

Definition at line 359 of file FormatterToXML.hpp.

◆ accumContent() [2/4]

void xalanc::FormatterToXML::accumContent ( const XalanDOMChar  chars[],
size_type  start,
size_type  length 
)
inlineprotected

Append an array of wide character to the buffer.

@chars the array to append @start the offset into the array to start from @length the number of characters to append

Definition at line 396 of file FormatterToXML.hpp.

References xalanc::length().

◆ accumContent() [3/4]

void xalanc::FormatterToXML::accumContent ( const XalanDOMString str)
inlineprotected

Append a string to the buffer.

Parameters
strthe string to append

Definition at line 429 of file FormatterToXML.hpp.

◆ accumContent() [4/4]

void xalanc::FormatterToXML::accumContent ( XalanDOMChar  ch)
inlineprotected

Append a wide character to the buffer.

@ch the character to append.

Definition at line 327 of file FormatterToXML.hpp.

◆ accumDefaultEntity()

virtual bool xalanc::FormatterToXML::accumDefaultEntity ( XalanDOMChar  ch,
bool  escLF 
)
protectedvirtual

Handle one of the default entities, return false if it is not a default entity.

Reimplemented in xalanc::FormatterToHTML.

◆ accumDefaultEscape()

size_type xalanc::FormatterToXML::accumDefaultEscape ( XalanDOMChar  ch,
size_type  i,
const XalanDOMChar  chars[],
size_type  len,
bool  escLF 
)
protected

Escape and accum a character.

◆ accumName() [1/4]

void xalanc::FormatterToXML::accumName ( const XalanDOMChar *  chars)
inlineprotected

Append a null-terminated array of wide characters to the buffer.

Characters that are not representable in the encoding are not written as entities.

@chars the array to append

Definition at line 345 of file FormatterToXML.hpp.

◆ accumName() [2/4]

void xalanc::FormatterToXML::accumName ( const XalanDOMChar  chars[],
size_type  start,
size_type  length 
)
inlineprotected

Append an array of wide character to the buffer.

Characters that are not representable in the encoding are not written as entities.

@chars the array to append @start the offset into the array to start from @length the number of characters to append

Definition at line 378 of file FormatterToXML.hpp.

References xalanc::length().

◆ accumName() [3/4]

void xalanc::FormatterToXML::accumName ( const XalanDOMString str)
inlineprotected

Append a string to the buffer.

Characters that are not representable in the encoding are not written as entities.

Parameters
strthe string to append

Definition at line 416 of file FormatterToXML.hpp.

◆ accumName() [4/4]

void xalanc::FormatterToXML::accumName ( XalanDOMChar  ch)
inlineprotected

Append a wide character to the buffer.

Characters that are not representable in the encoding are not written as entities.

@ch the character to append.

Definition at line 314 of file FormatterToXML.hpp.

◆ cdata()

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

Reimplemented in xalanc::FormatterToHTML.

◆ characters()

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

Reimplemented in xalanc::FormatterToHTML.

◆ charactersRaw()

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

◆ childNodesWereAdded()

bool xalanc::FormatterToXML::childNodesWereAdded ( )
protected

◆ comment()

virtual void xalanc::FormatterToXML::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 FormatterToXML* xalanc::FormatterToXML::create ( MemoryManager &  theManager,
Writer writer,
const XalanDOMString version = XalanDOMString(XalanMemMgrs::getDummyMemMgr()),
bool  doIndent = false,
int  indent = eDefaultIndentAmount,
const XalanDOMString encoding = XalanDOMString(XalanMemMgrs::getDummyMemMgr()),
const XalanDOMString mediaType = XalanDOMString(XalanMemMgrs::getDummyMemMgr()),
const XalanDOMString doctypeSystem = XalanDOMString(XalanMemMgrs::getDummyMemMgr()),
const XalanDOMString doctypePublic = XalanDOMString(XalanMemMgrs::getDummyMemMgr()),
bool  xmlDecl = true,
const XalanDOMString standalone = XalanDOMString(XalanMemMgrs::getDummyMemMgr()),
eFormat  format = OUTPUT_METHOD_XML,
bool  fBufferData = true 
)
static

◆ endDocument()

virtual void xalanc::FormatterToXML::endDocument ( )
virtual

Implements xalanc::FormatterListener.

Reimplemented in xalanc::FormatterToHTML.

◆ endElement()

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

Implements xalanc::FormatterListener.

Reimplemented in xalanc::FormatterToHTML.

◆ entityReference()

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

Receive notification of a entityReference.

Parameters
datapointer to characters from the XML document
Exceptions
SAXException

Implements xalanc::FormatterListener.

Reimplemented in xalanc::FormatterToHTML.

◆ flushBytes()

void xalanc::FormatterToXML::flushBytes ( )
protected

Flush the byte buffer.

◆ flushChars()

void xalanc::FormatterToXML::flushChars ( )
protected

Flush the char buffer.

◆ flushWriter()

void xalanc::FormatterToXML::flushWriter ( )
protected

◆ getDoctypePublic()

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

Reimplemented from xalanc::FormatterListener.

◆ getDoctypeSystem()

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

Reimplemented from xalanc::FormatterListener.

◆ getDoIndent()

bool xalanc::FormatterToXML::getDoIndent ( ) const
inline

Definition at line 250 of file FormatterToXML.hpp.

◆ getEncoding()

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

Reimplemented from xalanc::FormatterListener.

◆ getEscapeCData()

bool xalanc::FormatterToXML::getEscapeCData ( ) const
inline

Definition at line 238 of file FormatterToXML.hpp.

◆ getIndent()

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

Reimplemented from xalanc::FormatterListener.

◆ getMediaType()

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

Reimplemented from xalanc::FormatterListener.

◆ getMemoryManager()

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

Definition at line 124 of file FormatterToXML.hpp.

◆ getShouldWriteXMLHeader()

bool xalanc::FormatterToXML::getShouldWriteXMLHeader ( ) const
inline

Definition at line 214 of file FormatterToXML.hpp.

◆ getStandalone()

const XalanDOMString& xalanc::FormatterToXML::getStandalone ( ) const
inline

Definition at line 208 of file FormatterToXML.hpp.

◆ getStripCData()

bool xalanc::FormatterToXML::getStripCData ( ) const
inline

Definition at line 226 of file FormatterToXML.hpp.

◆ getVersion()

const XalanDOMString& xalanc::FormatterToXML::getVersion ( ) const
inline

Definition at line 202 of file FormatterToXML.hpp.

◆ getWriter()

virtual Writer* xalanc::FormatterToXML::getWriter ( ) const
virtual

Reimplemented from xalanc::FormatterListener.

◆ ignorableWhitespace()

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

◆ indent()

void xalanc::FormatterToXML::indent ( int  n)
protected

Prints a newline character and n spaces.

Parameters
nNumber of spaces to print.

◆ initAttrCharsMap()

void xalanc::FormatterToXML::initAttrCharsMap ( )
protected

Set the attribute characters what will require special mapping.

◆ initCharsMap()

void xalanc::FormatterToXML::initCharsMap ( )
protected

Set the output characters what will require special mapping.

◆ isUTF16Surrogate()

static bool xalanc::FormatterToXML::isUTF16Surrogate ( XalanDOMChar  ch)
inlinestaticprotected

Definition at line 586 of file FormatterToXML.hpp.

◆ openElementForChildren()

void xalanc::FormatterToXML::openElementForChildren ( )
protected

◆ outputLineSep()

void xalanc::FormatterToXML::outputLineSep ( )
protected

Output a line break.

◆ processingInstruction()

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

Implements xalanc::FormatterListener.

Reimplemented in xalanc::FormatterToHTML.

◆ resetDocument()

virtual void xalanc::FormatterToXML::resetDocument ( )
virtual

◆ setDocumentLocator()

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

◆ setDoIndent()

void xalanc::FormatterToXML::setDoIndent ( bool  value)
inline

Definition at line 256 of file FormatterToXML.hpp.

◆ setEscapeCData()

void xalanc::FormatterToXML::setEscapeCData ( bool  b)
inline

Definition at line 244 of file FormatterToXML.hpp.

◆ setIndent()

void xalanc::FormatterToXML::setIndent ( int  value)
inline

Definition at line 262 of file FormatterToXML.hpp.

◆ setShouldWriteXMLHeader()

void xalanc::FormatterToXML::setShouldWriteXMLHeader ( bool  b)
inline

Definition at line 220 of file FormatterToXML.hpp.

◆ setStripCData()

void xalanc::FormatterToXML::setStripCData ( bool  b)
inline

Definition at line 232 of file FormatterToXML.hpp.

◆ shouldIndent()

bool xalanc::FormatterToXML::shouldIndent ( ) const
inlineprotected

Definition at line 490 of file FormatterToXML.hpp.

◆ startDocument()

virtual void xalanc::FormatterToXML::startDocument ( )
virtual

Implements xalanc::FormatterListener.

Reimplemented in xalanc::FormatterToHTML.

◆ startElement()

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

Reimplemented in xalanc::FormatterToHTML.

◆ throwInvalidCharacterException()

static void xalanc::FormatterToXML::throwInvalidCharacterException ( XalanUnicodeChar  ch,
MemoryManager &  theManager 
)
staticprotected

Throw an exception when an invalid XML character is encountered.

Parameters
chThe first character in the surrogate
nextThe next character in the surrogate

◆ throwInvalidUTF16SurrogateException() [1/2]

static void xalanc::FormatterToXML::throwInvalidUTF16SurrogateException ( XalanDOMChar  ch,
MemoryManager &  theManager 
)
staticprotected

Throw an exception when an invalid surrogate is encountered.

Parameters
chThe first character in the surrogate
theManagerThe MemoryManager instance to use

◆ throwInvalidUTF16SurrogateException() [2/2]

static void xalanc::FormatterToXML::throwInvalidUTF16SurrogateException ( XalanDOMChar  ch,
XalanDOMChar  next,
MemoryManager &  theManager 
)
staticprotected

Throw an exception when an invalid surrogate is encountered.

Parameters
chThe first character in the surrogate
nextThe next character in the surrogate
theManagerThe MemoryManager instance to use

◆ writeAttrString()

virtual void xalanc::FormatterToXML::writeAttrString ( const XalanDOMChar *  theString,
size_type  theStringLength 
)
protectedvirtual

Write an attribute string.

Parameters
theStringThe string to write.
theStringLengthThe length of the string.

Reimplemented in xalanc::FormatterToHTML.

◆ writeNormalizedChars()

virtual void xalanc::FormatterToXML::writeNormalizedChars ( const XalanDOMChar  ch[],
size_type  start,
size_type  length,
bool  isCData 
)
protectedvirtual

Write normalized characters to the writer.

Parameters
chthe string to write.
startthe start offset into the string.
lengththe length of the string.
isCDatatrue if writing CDATA.

◆ writeNumberedEntityReference()

void xalanc::FormatterToXML::writeNumberedEntityReference ( XalanUnicodeChar  theNumber)
protected

Write a number into the buffer as an entity reference.

Parameters
theNumberthe number to write.

◆ writeParentTagEnd()

void xalanc::FormatterToXML::writeParentTagEnd ( )
protected

Check to see if a parent's ">" has been written, and, if it has not, write it.

Member Data Documentation

◆ m_attrCharsMap

XalanDOMChar xalanc::FormatterToXML::m_attrCharsMap[SPECIALSSIZE]
protected

Definition at line 599 of file FormatterToXML.hpp.

◆ m_charsMap

XalanDOMChar xalanc::FormatterToXML::m_charsMap[SPECIALSSIZE]
protected

Definition at line 601 of file FormatterToXML.hpp.

◆ m_currentIndent

int xalanc::FormatterToXML::m_currentIndent
protected

Flag to keep track of the indent amount.

Definition at line 677 of file FormatterToXML.hpp.

◆ m_doctypePublic

const XalanDOMString xalanc::FormatterToXML::m_doctypePublic
protected

The public ID for the doc type.

Definition at line 667 of file FormatterToXML.hpp.

◆ m_doctypeSystem

const XalanDOMString xalanc::FormatterToXML::m_doctypeSystem
protected

The System ID for the doc type.

Definition at line 662 of file FormatterToXML.hpp.

◆ m_doIndent

bool xalanc::FormatterToXML::m_doIndent
protected

Flag to tell if indenting (pretty-printing) is on.

Definition at line 617 of file FormatterToXML.hpp.

◆ m_encoding

XalanDOMString xalanc::FormatterToXML::m_encoding
protected

The character encoding.

Definition at line 672 of file FormatterToXML.hpp.

◆ m_encodingIsUTF

bool xalanc::FormatterToXML::m_encodingIsUTF
protected

Flag to quickly tell if the encoding is capable of full Unicode support.

Definition at line 657 of file FormatterToXML.hpp.

◆ m_inCData

bool xalanc::FormatterToXML::m_inCData
protected

Tells if we're in CData section.

Definition at line 651 of file FormatterToXML.hpp.

◆ m_indent

int xalanc::FormatterToXML::m_indent
protected

Amount to indent.

Definition at line 682 of file FormatterToXML.hpp.

◆ m_ispreserve

bool xalanc::FormatterToXML::m_ispreserve
protected

State flag to tell if preservation of whitespace is important.

Definition at line 612 of file FormatterToXML.hpp.

◆ m_isprevtext

bool xalanc::FormatterToXML::m_isprevtext
protected

State flag that tells if the previous node processed was text, so we can tell if we should preserve whitespace.

Definition at line 635 of file FormatterToXML.hpp.

◆ m_maxCharacter

XalanDOMChar xalanc::FormatterToXML::m_maxCharacter
protected

The maximum character size before we have to resort to escaping.

Definition at line 597 of file FormatterToXML.hpp.

◆ m_needToOutputDocTypeDecl

bool xalanc::FormatterToXML::m_needToOutputDocTypeDecl
protected

Flag to tell that we need to add the doctype decl, which we can't do until the first element is encountered.

Definition at line 629 of file FormatterToXML.hpp.

◆ m_nextIsRaw

bool xalanc::FormatterToXML::m_nextIsRaw
protected

Tell if the next text should be raw.

Definition at line 646 of file FormatterToXML.hpp.

◆ m_preserves

BoolStackType xalanc::FormatterToXML::m_preserves
protected

Stack to keep track of whether or not we need to preserve whitespace.

Definition at line 688 of file FormatterToXML.hpp.

◆ m_shouldWriteXMLHeader

bool xalanc::FormatterToXML::m_shouldWriteXMLHeader
protected

If true, XML header should be written to output.

Definition at line 606 of file FormatterToXML.hpp.

◆ m_startNewLine

bool xalanc::FormatterToXML::m_startNewLine
protected

Flag to signal that a newline should be added.

Definition at line 622 of file FormatterToXML.hpp.

◆ m_stream

XalanOutputStream* const xalanc::FormatterToXML::m_stream
protected

The stream where the XML will be written.

Definition at line 283 of file FormatterToXML.hpp.

◆ m_stringBuffer

XalanDOMString xalanc::FormatterToXML::m_stringBuffer
protected

Definition at line 693 of file FormatterToXML.hpp.

◆ m_stripCData

bool xalanc::FormatterToXML::m_stripCData
protected

If true, cdata sections are simply stripped of their CDATA brackets, without escaping.

Definition at line 641 of file FormatterToXML.hpp.

◆ m_writer

Writer* const xalanc::FormatterToXML::m_writer
protected

The writer where the XML will be written.

Definition at line 278 of file FormatterToXML.hpp.


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