Xalan-C++ API Documentation

The Xalan C++ XSLT Processor Version 1.10

FormatterToXML Class Reference

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

Inheritance diagram for FormatterToXML:

FormatterListener FormatterToHTML

List of all members.

Public Types

Public Member Functions

Static Public Member Functions

Protected Types

Protected Member Functions

Static Protected Member Functions

Protected Attributes


Detailed Description

FormatterToXML formats SAX-style events into XML.

Member Typedef Documentation

typedef void(FormatterToXML::* FormatterToXML::AccumCharFunctionType)(XalanDOMChar) [protected]

typedef void(FormatterToXML::* FormatterToXML::AccumStringFunctionType)(const XalanDOMChar *) [protected]

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

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

typedef void(FormatterToXML::* FormatterToXML::FlushFunctionType)() [protected]


Member Enumeration Documentation

Enumerator:
eDefaultIndentAmount 

enum FormatterToXML::eDummyTwo [protected]

Enumerator:
SPECIALSSIZE 


Constructor & Destructor Documentation

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,
MemoryManagerType &theManager  XALAN_DEFAULT_MEMMGR 
)

Constructor for customized encoding and doctype.

Parameters:
writer character output stream to use
version version of the output method
doIndent true if output is to be indented
indent number of spaces to indent at each nesting level
encoding character encoding in use by writer
mediaType media type (MIME content type) of the data
doctypeSystem system identifier to be used in the document type declaration
doctypePublic public identifier to be used in the document type declaration
xmlDecl true if the XSLT processor should output an XML declaration
standalone true if the XSLT processor should output a standalone document declaration
format should be used only by derived classes.
fBufferData If true, data will be buffered in the formatter

virtual FormatterToXML::~FormatterToXML (  )  [virtual]


Member Function Documentation

static FormatterToXML* FormatterToXML::create ( MemoryManagerType 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]

MemoryManagerType& FormatterToXML::getMemoryManager (  ) 

virtual void FormatterToXML::setDocumentLocator ( const LocatorType *const   locator  )  [virtual]

virtual void FormatterToXML::startDocument (  )  [virtual]

Implements FormatterListener.

Reimplemented in FormatterToHTML.

virtual void FormatterToXML::endDocument (  )  [virtual]

Implements FormatterListener.

Reimplemented in FormatterToHTML.

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

Reimplemented in FormatterToHTML.

virtual void FormatterToXML::endElement ( const XMLCh *const   name  )  [virtual]

Implements FormatterListener.

Reimplemented in FormatterToHTML.

virtual void FormatterToXML::characters ( const XMLCh *const   chars,
const unsigned int  length 
) [virtual]

Implements FormatterListener.

Reimplemented in FormatterToHTML.

virtual void FormatterToXML::charactersRaw ( const XMLCh *const   chars,
const unsigned int  length 
) [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 

Implements FormatterListener.

virtual void FormatterToXML::entityReference ( const XMLCh *const   name  )  [virtual]

Receive notification of a entityReference.

Parameters:
data pointer to characters from the XML document
Exceptions:
SAXException 

Implements FormatterListener.

Reimplemented in FormatterToHTML.

virtual void FormatterToXML::ignorableWhitespace ( const XMLCh *const   chars,
const unsigned int  length 
) [virtual]

Implements FormatterListener.

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

Implements FormatterListener.

Reimplemented in FormatterToHTML.

virtual void FormatterToXML::resetDocument (  )  [virtual]

Implements FormatterListener.

virtual void FormatterToXML::comment ( const XMLCh *const   data  )  [virtual]

Called when a Comment is to be constructed.

Parameters:
data pointer to comment data
Exceptions:
SAXException 

Implements FormatterListener.

virtual void FormatterToXML::cdata ( const XMLCh *const   ch,
const unsigned int  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:
ch pointer to characters from the XML document
length number of characters to read from the array
Exceptions:
SAXException 

Implements FormatterListener.

Reimplemented in FormatterToHTML.

virtual Writer* FormatterToXML::getWriter (  )  const [virtual]

Reimplemented from FormatterListener.

virtual const XalanDOMString& FormatterToXML::getDoctypeSystem (  )  const [virtual]

Reimplemented from FormatterListener.

virtual const XalanDOMString& FormatterToXML::getDoctypePublic (  )  const [virtual]

Reimplemented from FormatterListener.

virtual const XalanDOMString& FormatterToXML::getEncoding (  )  const [virtual]

Reimplemented from FormatterListener.

virtual const XalanDOMString& FormatterToXML::getMediaType (  )  const [virtual]

Reimplemented from FormatterListener.

virtual int FormatterToXML::getIndent (  )  const [virtual]

Reimplemented from FormatterListener.

const XalanDOMString& FormatterToXML::getVersion (  )  const

const XalanDOMString& FormatterToXML::getStandalone (  )  const

bool FormatterToXML::getShouldWriteXMLHeader (  )  const

void FormatterToXML::setShouldWriteXMLHeader ( bool  b  ) 

bool FormatterToXML::getStripCData (  )  const

void FormatterToXML::setStripCData ( bool  b  ) 

bool FormatterToXML::getEscapeCData (  )  const

void FormatterToXML::setEscapeCData ( bool  b  ) 

bool FormatterToXML::getDoIndent (  )  const

void FormatterToXML::setDoIndent ( bool  value  ) 

void FormatterToXML::setIndent ( int  value  ) 

void FormatterToXML::outputLineSep (  )  [protected]

Output a line break.

void FormatterToXML::accumName ( XalanDOMChar  ch  )  [protected]

Append a wide character to the buffer.

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

the character to append.

void FormatterToXML::accumContent ( XalanDOMChar  ch  )  [protected]

Append a wide character to the buffer.

the character to append.

void FormatterToXML::accumName ( const XalanDOMChar *  chars  )  [protected]

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

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

the array to append

void FormatterToXML::accumContent ( const XalanDOMChar *  chars  )  [protected]

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

the array to append

void FormatterToXML::accumName ( const XalanDOMChar  chars[],
XalanDOMString::size_type  start,
XalanDOMString::size_type  length 
) [protected]

Append an array of wide character to the buffer.

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

the array to append the offset into the array to start from the number of characters to append

void FormatterToXML::accumContent ( const XalanDOMChar  chars[],
XalanDOMString::size_type  start,
XalanDOMString::size_type  length 
) [protected]

Append an array of wide character to the buffer.

the array to append the offset into the array to start from the number of characters to append

void FormatterToXML::accumName ( const XalanDOMString str  )  [protected]

Append a string to the buffer.

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

Parameters:
str the string to append

void FormatterToXML::accumContent ( const XalanDOMString str  )  [protected]

Append a string to the buffer.

Parameters:
str the string to append

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

Escape and accum a character.

virtual bool FormatterToXML::accumDefaultEntity ( XalanDOMChar  ch,
bool  escLF 
) [protected, virtual]

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

Reimplemented in FormatterToHTML.

void FormatterToXML::initAttrCharsMap (  )  [protected]

Set the attribute characters what will require special mapping.

void FormatterToXML::initCharsMap (  )  [protected]

Set the output characters what will require special mapping.

void FormatterToXML::flushChars (  )  [protected]

Flush the char buffer.

void FormatterToXML::flushBytes (  )  [protected]

Flush the byte buffer.

void FormatterToXML::flushWriter (  )  [protected]

void FormatterToXML::openElementForChildren (  )  [protected]

bool FormatterToXML::childNodesWereAdded (  )  [protected]

bool FormatterToXML::shouldIndent (  )  const [protected]

void FormatterToXML::writeParentTagEnd (  )  [protected]

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

void FormatterToXML::indent ( int  n  )  [protected]

Prints a newline character and n spaces.

Parameters:
n Number of spaces to print.

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

Write normalized characters to the writer.

Parameters:
ch the string to write.
start the start offset into the string.
length the length of the string.
isCData true if writing CDATA.

void FormatterToXML::writeNumberedEntityReference ( unsigned long  theNumber  )  [protected]

Write a number into the buffer as an entity reference.

Parameters:
theNumber the number to write.

virtual void FormatterToXML::writeAttrString ( const XalanDOMChar *  theString,
XalanDOMString::size_type  theStringLength 
) [protected, virtual]

Write an attribute string.

Parameters:
theString The string to write.
theStringLength The length of the string.

Reimplemented in FormatterToHTML.

virtual void FormatterToXML::accumCommentData ( const XalanDOMChar *  data  )  [protected, virtual]

Write the data for a comment.

Parameters:
data The comment's data.

Reimplemented in FormatterToHTML.

static void FormatterToXML::throwInvalidUTF16SurrogateException ( XalanDOMChar  ch,
MemoryManagerType theManager 
) [static, protected]

Throw an exception when an invalid surrogate is encountered.

Parameters:
ch The first character in the surrogate
theManager The MemoryManager instance to use

static void FormatterToXML::throwInvalidUTF16SurrogateException ( XalanDOMChar  ch,
XalanDOMChar  next,
MemoryManagerType theManager 
) [static, protected]

Throw an exception when an invalid surrogate is encountered.

Parameters:
ch The first character in the surrogate
next The next character in the surrogate
theManager The MemoryManager instance to use

static void FormatterToXML::throwInvalidCharacterException ( unsigned int  ch,
MemoryManagerType theManager 
) [static, protected]

Throw an exception when an invalid XML character is encountered.

Parameters:
ch The first character in the surrogate
next The next character in the surrogate

static bool FormatterToXML::isUTF16Surrogate ( XalanDOMChar  ch  )  [static, protected]


Member Data Documentation

Writer* const FormatterToXML::m_writer [protected]

The writer where the XML will be written.

The stream where the XML will be written.

XalanDOMChar FormatterToXML::m_maxCharacter [protected]

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

XalanDOMChar FormatterToXML::m_attrCharsMap[SPECIALSSIZE] [protected]

XalanDOMChar FormatterToXML::m_charsMap[SPECIALSSIZE] [protected]

If true, XML header should be written to output.

bool FormatterToXML::m_ispreserve [protected]

State flag to tell if preservation of whitespace is important.

bool FormatterToXML::m_doIndent [protected]

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

Flag to signal that a newline should be added.

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

bool FormatterToXML::m_isprevtext [protected]

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

bool FormatterToXML::m_stripCData [protected]

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

bool FormatterToXML::m_nextIsRaw [protected]

Tell if the next text should be raw.

bool FormatterToXML::m_inCData [protected]

Tells if we're in CData section.

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

The System ID for the doc type.

The public ID for the doc type.

The character encoding.

Flag to keep track of the indent amount.

int FormatterToXML::m_indent [protected]

Amount to indent.

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


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.

dot

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

Apache Logo