Xalan-C++ API Documentation
Xalan-C++ API Documentation
The Xalan-C++ XSL Transformer Version 1.0
Main Page Namespace List Class Hierarchy Alphabetical List Compound List File List Compound Members File Members
FormatterToXML Class Reference
FormatterToXML formats SAX-style events into XML.
More...
#include <FormatterToXML.hpp>
Inheritance diagram for FormatterToXML:
Collaboration diagram for FormatterToXML:
List of all members.
Public Types
Public Methods
- FormatterToXML ( Writer& writer, const XalanDOMString& version = XalanDOMString(), bool doIndent = false, int indent = eDefaultIndentAmount, const XalanDOMString& encoding = XalanDOMString(), const XalanDOMString& mediaType = XalanDOMString(), const XalanDOMString& doctypeSystem = XalanDOMString(), const XalanDOMString& doctypePublic = XalanDOMString(), bool xmlDecl = true, const XalanDOMString& standalone = XalanDOMString(), eFormat format = OUTPUT_METHOD_XML)
- Constructor for customized encoding and doctype. More...
- virtual ~FormatterToXML ()
- virtual void setDocumentLocator (const Locator* const locator)
- virtual void startDocument ()
- virtual void endDocument ()
- virtual void startElement ( const XMLCh* const name, AttributeList& attrs)
- virtual void endElement (const XMLCh* const name)
- virtual void characters ( const XMLCh* const chars, const unsigned int length)
- virtual void charactersRaw ( const XMLCh* const chars, const unsigned int length)
- Receive notification of character data. More...
- virtual void entityReference (const XMLCh* const name)
- Receive notification of a entityReference. More...
- virtual void ignorableWhitespace ( const XMLCh* const chars, const unsigned int 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 unsigned int length)
- Receive notification of cdata. More...
- const Writer& getWriter () const
- Writer& getWriter ()
- const XalanDOMString& getDoctypeSystem () const
- const XalanDOMString& getDoctypePublic () const
- const XalanDOMString& getEncoding () const
- const XalanDOMString& getMediaType () const
- const XalanDOMString& getVersion () const
- const XalanDOMString& getStandalone () 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
- int getIndent () const
Static Public Methods
Protected Types
Protected Methods
- void outputLineSep ()
- Output a line break.
- void accum (XalanDOMChar ch)
- Append a wide character to the buffer. More...
- void accum (const XalanDOMChar* chars)
- Append a mull-termiated array of wide character to the buffer. More...
- void accum ( const XalanDOMChar chars[], unsigned int start, unsigned int length)
- Append an array of wide character to the buffer. More...
- void accum (const XalanDOMString& str)
- Append a string to the buffer. More...
- void accum (const XalanDOMCharVectorType& theVector)
- Append a vector of wide characters to the buffer. More...
- void accumDefaultEscape ( XalanDOMChar ch, unsigned int i, const XalanDOMChar chars[], unsigned int len, bool escLF)
- Escape and accum a character.
- bool accumDefaultEntity ( XalanDOMChar ch, unsigned int i, const XalanDOMChar chars[], unsigned int len, bool escLF)
- Handle one of the default entities, return false if it is not a default entity.
- void initAttrCharsMap ()
- Set the attribute characters what will require special mapping.
- void initCharsMap ()
- Set the output characters what will require special mapping.
- void flushChars ()
- Flush the char buffer.
- void flushBytes ()
- Flush the byte buffer.
- void flush ()
- 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.
- void indent (int n)
- Prints a newline character and n spaces. More...
- virtual void writeNormalizedChars ( const XalanDOMChar ch[], unsigned int start, unsigned int length, bool isCData)
- Write normalized characters to the writer. More...
- void writeNumberedEntityReference (unsigned long theNumber)
- Write a number into the buffer as an entity reference. More...
- virtual void writeAttrString ( const XalanDOMChar* string, const XalanDOMString& encoding)
- Write an attribute string. More...
Protected Attributes
Static Protected Methods
Static Protected Attributes
Detailed Description
FormatterToXML formats SAX-style events into XML.
Member Typedef Documentation
typedef std::vector<bool> FormatterToXML::BoolStackType |
|
typedef std::vector<char> FormatterToXML::ByteBufferType |
|
typedef std::vector<XalanDOMChar> FormatterToXML::DOMCharBufferType |
|
Member Enumeration Documentation
enum FormatterToXML::eDummy |
|
enum FormatterToXML::eDummyTwo [protected] |
|
Constructor & Destructor Documentation
FormatterToXML::FormatterToXML (
|
Writer & writer, |
|
const XalanDOMString & version = XalanDOMString(), |
|
bool doIndent = false, |
|
int indent = eDefaultIndentAmount, |
|
const XalanDOMString & encoding = XalanDOMString(), |
|
const XalanDOMString & mediaType = XalanDOMString(), |
|
const XalanDOMString & doctypeSystem = XalanDOMString(), |
|
const XalanDOMString & doctypePublic = XalanDOMString(), |
|
bool xmlDecl = true, |
|
const XalanDOMString & standalone = XalanDOMString(), |
|
eFormat format = OUTPUT_METHOD_XML) |
|
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
|
-
Parameters:
-
format
|
should be used only by derived classes.
|
virtual FormatterToXML::~FormatterToXML () [virtual] |
|
Member Function Documentation
Append a vector of wide characters to the buffer.
-
Parameters:
-
theVector
|
the vector to append
|
Append a string to the buffer.
-
Parameters:
-
void FormatterToXML::accum (
|
const XalanDOMChar chars[], |
|
unsigned int start, |
|
unsigned int length) [protected] |
|
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
void FormatterToXML::accum (
|
const XalanDOMChar * chars) [protected] |
|
Append a mull-termiated array of wide character to the buffer.
@chars the array to append
Append a wide character to the buffer.
@ch the character to append.
bool FormatterToXML::accumDefaultEntity (
|
XalanDOMChar ch, |
|
unsigned int i, |
|
const XalanDOMChar chars[], |
|
unsigned int len, |
|
bool escLF) [protected] |
|
Handle one of the default entities, return false if it is not a default entity.
void FormatterToXML::accumDefaultEscape (
|
XalanDOMChar ch, |
|
unsigned int i, |
|
const XalanDOMChar chars[], |
|
unsigned int len, |
|
bool escLF) [protected] |
|
Escape and accum a character.
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:
-
Reimplemented from FormatterListener.
Reimplemented in FormatterToHTML.
virtual void FormatterToXML::characters (
|
const XMLCh * const chars, |
|
const unsigned int length) [virtual] |
|
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:
-
Reimplemented from FormatterListener.
bool FormatterToXML::childNodesWereAdded () [protected] |
|
virtual void FormatterToXML::comment (
|
const XMLCh * const data) [virtual] |
|
Called when a Comment is to be constructed.
-
Parameters:
-
data
|
pointer to comment data
|
-
Exceptions:
-
Reimplemented from FormatterListener.
virtual void FormatterToXML::endDocument () [virtual] |
|
virtual void FormatterToXML::endElement (
|
const XMLCh * const name) [virtual] |
|
virtual void FormatterToXML::entityReference (
|
const XMLCh * const name) [virtual] |
|
Receive notification of a entityReference.
-
Parameters:
-
data
|
pointer to characters from the XML document
|
-
Exceptions:
-
Reimplemented from FormatterListener.
Reimplemented in FormatterToHTML.
void FormatterToXML::flush () [protected] |
|
void FormatterToXML::flushBytes () [protected] |
|
void FormatterToXML::flushChars () [protected] |
|
void FormatterToXML::flushWriter () [protected] |
|
bool FormatterToXML::getDoIndent () const |
|
bool FormatterToXML::getEscapeCData () const |
|
int FormatterToXML::getIndent () const |
|
Get the maximum character value for the encoding.
-
Parameters:
-
theEncoding
|
The encoding name.
|
-
Returns:
-
The maximum character value that the
encoding supports.
bool FormatterToXML::getShouldWriteXMLHeader () const |
|
bool FormatterToXML::getStripCData () const |
|
Writer & FormatterToXML::getWriter () |
|
const Writer & FormatterToXML::getWriter () const |
|
virtual void FormatterToXML::ignorableWhitespace (
|
const XMLCh * const chars, |
|
const unsigned int length) [virtual] |
|
void FormatterToXML::indent (
|
int n) [protected] |
|
Prints a newline character and n spaces.
-
Parameters:
-
n
|
Number of spaces to print.
|
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::initialize () [static] |
|
void FormatterToXML::openElementForChildren () [protected] |
|
void FormatterToXML::outputLineSep () [protected] |
|
virtual void FormatterToXML::processingInstruction (
|
const XMLCh * const target, |
|
const XMLCh * const data) [virtual] |
|
virtual void FormatterToXML::resetDocument () [virtual] |
|
virtual void FormatterToXML::setDocumentLocator (
|
const Locator * const locator) [virtual] |
|
void FormatterToXML::setEscapeCData (
|
bool b) |
|
void FormatterToXML::setShouldWriteXMLHeader (
|
bool b) |
|
void FormatterToXML::setStripCData (
|
bool b) |
|
bool FormatterToXML::shouldIndent () const [protected] |
|
virtual void FormatterToXML::startDocument () [virtual] |
|
virtual void FormatterToXML::startElement (
|
const XMLCh * const name, |
|
AttributeList & attrs) [virtual] |
|
void FormatterToXML::terminate () [static] |
|
void FormatterToXML::throwInvalidUTF16SurrogateException (
|
XalanDOMChar ch, |
|
unsigned int next) [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
|
void FormatterToXML::throwInvalidUTF16SurrogateException (
|
XalanDOMChar ch) [static, protected] |
|
Throw an exception when an invalid surrogate is encountered.
-
Parameters:
-
ch
|
The first character in the surrogate
|
Write an attribute string.
-
Parameters:
-
string
|
The string to write.
|
encoding
|
The current encoding.
|
Reimplemented in FormatterToHTML.
void FormatterToXML::writeNormalizedChars (
|
const XalanDOMChar ch[], |
|
unsigned int start, |
|
unsigned int 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.
|
void FormatterToXML::writeParentTagEnd () [protected] |
|
Check to see if a parent's ">" has been written, and, if it has not, write it.
Member Data Documentation
XalanDOMChar FormatterToXML::m_attrCharsMap[SPECIALSSIZE] [protected] |
|
XalanDOMChar FormatterToXML::m_charsMap[SPECIALSSIZE] [protected] |
|
int FormatterToXML::m_currentIndent [protected] |
|
Flag to keep track of the indent amount.
bool FormatterToXML::m_doIndent [protected] |
|
Flag to tell if indenting (pretty-printing) is on.
The public ID for the doc type.
The System ID for the doc type.
bool FormatterToXML::m_inCData [protected] |
|
Tells if we're in CData section.
int FormatterToXML::m_indent [protected] |
|
bool FormatterToXML::m_isUTF8 [protected] |
|
Flag to quickly tell if the encoding is UTF8.
bool FormatterToXML::m_ispreserve [protected] |
|
State flag to tell if preservation of whitespace is important.
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.
The maximum character size before we have to resort to escaping.
bool 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.
bool FormatterToXML::m_nextIsRaw [protected] |
|
Tell if the next text should be raw.
Stack to keep track of whether or not we need to preserve whitespace.
bool FormatterToXML::m_shouldWriteXMLHeader [protected] |
|
If true, XML header should be written to output.
bool FormatterToXML::m_startNewLine [protected] |
|
Flag to signal that a newline should be added.
bool FormatterToXML::m_stripCData [protected] |
|
If true, cdata sections are simply stripped of their CDATA brackets, without escaping.
Writer & FormatterToXML::m_writer [protected] |
|
The writer where the XML will be written.
The string "formatter-to-dom".
The text "xslt-next-is-raw".
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++ XSL Transformer Version 1.0
Copyright © 2000 The Apache Software Foundation. All Rights Reserved.
|
|