Xalan-C++ API Reference 1.12.0
|
FormatterToXML formats SAX-style events into XML. More...
#include <xalanc/XMLSupport/FormatterToXML.hpp>
Public Types | |
enum | eDummy { eDefaultIndentAmount = 0 } |
typedef XalanVector< bool > | BoolStackType |
typedef XalanVector< XalanDOMChar > | DOMCharBufferType |
typedef XalanVector< char > | ByteBufferType |
![]() | |
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 |
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. | |
void | accumName (XalanDOMChar ch) |
Append a wide character to the buffer. | |
void | accumContent (XalanDOMChar ch) |
Append a wide character to the buffer. | |
void | accumName (const XalanDOMChar *chars) |
Append a null-terminated array of wide characters to the buffer. | |
void | accumContent (const XalanDOMChar *chars) |
Append a null-terminated array of wide characters to the buffer. | |
void | accumName (const XalanDOMChar chars[], size_type start, size_type length) |
Append an array of wide character to the buffer. | |
void | accumContent (const XalanDOMChar chars[], size_type start, size_type length) |
Append an array of wide character to the buffer. | |
void | accumName (const XalanDOMString &str) |
Append a string to the buffer. | |
void | accumContent (const XalanDOMString &str) |
Append a string to the buffer. | |
size_type | accumDefaultEscape (XalanDOMChar ch, size_type i, const XalanDOMChar chars[], size_type len, bool escLF) |
Escape and accum a character. | |
virtual bool | accumDefaultEntity (XalanDOMChar ch, 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 | 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. | |
virtual void | writeNormalizedChars (const XalanDOMChar ch[], size_type start, size_type length, bool isCData) |
Write normalized characters to the writer. | |
void | writeNumberedEntityReference (XalanUnicodeChar theNumber) |
Write a number into the buffer as an entity reference. | |
virtual void | writeAttrString (const XalanDOMChar *theString, size_type theStringLength) |
Write an attribute string. | |
virtual void | accumCommentData (const XalanDOMChar *data) |
Write the data for a comment. | |
![]() | |
void | setXMLVersion (eXMLVersion theVersion) |
Set the output version during serializing. | |
Static Protected Member Functions | |
static void | throwInvalidUTF16SurrogateException (XalanDOMChar ch, MemoryManager &theManager) |
Throw an exception when an invalid surrogate is encountered. | |
static void | throwInvalidUTF16SurrogateException (XalanDOMChar ch, XalanDOMChar next, MemoryManager &theManager) |
Throw an exception when an invalid surrogate is encountered. | |
static void | throwInvalidCharacterException (XalanUnicodeChar ch, MemoryManager &theManager) |
Throw an exception when an invalid XML character is encountered. | |
static bool | isUTF16Surrogate (XalanDOMChar ch) |
Protected Attributes | |
Writer *const | m_writer |
The writer where the XML will be written. | |
XalanOutputStream *const | m_stream |
The stream where the XML will be written. | |
XalanDOMChar | m_maxCharacter |
The maximum character size before we have to resort to escaping. | |
XalanDOMChar | m_attrCharsMap [SPECIALSSIZE] |
XalanDOMChar | m_charsMap [SPECIALSSIZE] |
bool | m_shouldWriteXMLHeader |
If true, XML header should be written to output. | |
bool | m_ispreserve |
State flag to tell if preservation of whitespace is important. | |
bool | m_doIndent |
Flag to tell if indenting (pretty-printing) is on. | |
bool | m_startNewLine |
Flag to signal that a newline should be added. | |
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. | |
bool | m_isprevtext |
State flag that tells if the previous node processed was text, so we can tell if we should preserve whitespace. | |
bool | m_stripCData |
If true, cdata sections are simply stripped of their CDATA brackets, without escaping. | |
bool | m_nextIsRaw |
Tell if the next text should be raw. | |
bool | m_inCData |
Tells if we're in CData section. | |
bool | m_encodingIsUTF |
Flag to quickly tell if the encoding is capable of full Unicode support. | |
const XalanDOMString | m_doctypeSystem |
The System ID for the doc type. | |
const XalanDOMString | m_doctypePublic |
The public ID for the doc type. | |
XalanDOMString | m_encoding |
The character encoding. | |
int | m_currentIndent |
Flag to keep track of the indent amount. | |
int | m_indent |
Amount to indent. | |
BoolStackType | m_preserves |
Stack to keep track of whether or not we need to preserve whitespace. | |
XalanDOMString | m_stringBuffer |
![]() | |
const PrefixResolver * | m_prefixResolver |
Additional Inherited Members | |
![]() | |
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 const XalanDOMString | s_emptyString |
FormatterToXML formats SAX-style events into XML.
Definition at line 59 of file FormatterToXML.hpp.
|
protected |
Definition at line 297 of file FormatterToXML.hpp.
|
protected |
Definition at line 291 of file FormatterToXML.hpp.
|
protected |
Definition at line 295 of file FormatterToXML.hpp.
|
protected |
Definition at line 293 of file FormatterToXML.hpp.
Definition at line 268 of file FormatterToXML.hpp.
Definition at line 270 of file FormatterToXML.hpp.
Definition at line 269 of file FormatterToXML.hpp.
Definition at line 302 of file FormatterToXML.hpp.
Enumerator | |
---|---|
eDefaultIndentAmount |
Definition at line 63 of file FormatterToXML.hpp.
|
protected |
Enumerator | |
---|---|
SPECIALSSIZE |
Definition at line 591 of file FormatterToXML.hpp.
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.
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 |
|
protectedvirtual |
Write the data for a comment.
data | The comment's data. |
Reimplemented in xalanc::FormatterToHTML.
|
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.
|
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().
|
inlineprotected |
Append a string to the buffer.
str | the string to append |
Definition at line 429 of file FormatterToXML.hpp.
|
inlineprotected |
Append a wide character to the buffer.
@ch the character to append.
Definition at line 327 of file FormatterToXML.hpp.
|
protectedvirtual |
Handle one of the default entities, return false if it is not a default entity.
Reimplemented in xalanc::FormatterToHTML.
|
protected |
Escape and accum a character.
|
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.
|
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().
|
inlineprotected |
Append a string to the buffer.
Characters that are not representable in the encoding are not written as entities.
str | the string to append |
Definition at line 416 of file FormatterToXML.hpp.
|
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.
|
virtual |
Reimplemented in xalanc::FormatterToHTML.
|
virtual |
Reimplemented in xalanc::FormatterToHTML.
|
virtual |
|
protected |
Called when a Comment is to be constructed.
data | pointer to comment data |
SAXException |
Implements xalanc::FormatterListener.
|
static |
Implements xalanc::FormatterListener.
Reimplemented in xalanc::FormatterToHTML.
Implements xalanc::FormatterListener.
Reimplemented in xalanc::FormatterToHTML.
Receive notification of a entityReference.
data | pointer to characters from the XML document |
SAXException |
Implements xalanc::FormatterListener.
Reimplemented in xalanc::FormatterToHTML.
|
protected |
Flush the byte buffer.
|
protected |
Flush the char buffer.
|
protected |
|
virtual |
Reimplemented from xalanc::FormatterListener.
|
virtual |
Reimplemented from xalanc::FormatterListener.
|
inline |
Definition at line 250 of file FormatterToXML.hpp.
|
virtual |
Reimplemented from xalanc::FormatterListener.
|
inline |
Definition at line 238 of file FormatterToXML.hpp.
Reimplemented from xalanc::FormatterListener.
|
virtual |
Reimplemented from xalanc::FormatterListener.
|
inline |
Definition at line 124 of file FormatterToXML.hpp.
|
inline |
Definition at line 214 of file FormatterToXML.hpp.
|
inline |
Definition at line 208 of file FormatterToXML.hpp.
|
inline |
Definition at line 226 of file FormatterToXML.hpp.
|
inline |
Definition at line 202 of file FormatterToXML.hpp.
Reimplemented from xalanc::FormatterListener.
|
virtual |
Prints a newline character and n spaces.
n | Number of spaces to print. |
|
protected |
Set the attribute characters what will require special mapping.
|
protected |
Set the output characters what will require special mapping.
|
inlinestaticprotected |
Definition at line 586 of file FormatterToXML.hpp.
|
protected |
|
protected |
Output a line break.
|
virtual |
Implements xalanc::FormatterListener.
Reimplemented in xalanc::FormatterToHTML.
Implements xalanc::FormatterListener.
Implements xalanc::FormatterListener.
Definition at line 256 of file FormatterToXML.hpp.
Definition at line 244 of file FormatterToXML.hpp.
Definition at line 262 of file FormatterToXML.hpp.
Definition at line 220 of file FormatterToXML.hpp.
Definition at line 232 of file FormatterToXML.hpp.
|
inlineprotected |
Definition at line 490 of file FormatterToXML.hpp.
Implements xalanc::FormatterListener.
Reimplemented in xalanc::FormatterToHTML.
|
virtual |
Reimplemented in xalanc::FormatterToHTML.
|
staticprotected |
Throw an exception when an invalid XML character is encountered.
ch | The first character in the surrogate |
next | The next character in the surrogate |
|
staticprotected |
Throw an exception when an invalid surrogate is encountered.
ch | The first character in the surrogate |
theManager | The MemoryManager instance to use |
|
staticprotected |
Throw an exception when an invalid surrogate is encountered.
ch | The first character in the surrogate |
next | The next character in the surrogate |
theManager | The MemoryManager instance to use |
|
protectedvirtual |
Write an attribute string.
theString | The string to write. |
theStringLength | The length of the string. |
Reimplemented in xalanc::FormatterToHTML.
|
protectedvirtual |
Write normalized characters to the writer.
ch | the string to write. |
start | the start offset into the string. |
length | the length of the string. |
isCData | true if writing CDATA. |
|
protected |
Write a number into the buffer as an entity reference.
theNumber | the number to write. |
|
protected |
Check to see if a parent's ">" has been written, and, if it has not, write it.
|
protected |
Definition at line 599 of file FormatterToXML.hpp.
|
protected |
Definition at line 601 of file FormatterToXML.hpp.
|
protected |
Flag to keep track of the indent amount.
Definition at line 677 of file FormatterToXML.hpp.
|
protected |
The public ID for the doc type.
Definition at line 667 of file FormatterToXML.hpp.
|
protected |
The System ID for the doc type.
Definition at line 662 of file FormatterToXML.hpp.
|
protected |
Flag to tell if indenting (pretty-printing) is on.
Definition at line 617 of file FormatterToXML.hpp.
|
protected |
The character encoding.
Definition at line 672 of file FormatterToXML.hpp.
|
protected |
Flag to quickly tell if the encoding is capable of full Unicode support.
Definition at line 657 of file FormatterToXML.hpp.
|
protected |
Tells if we're in CData section.
Definition at line 651 of file FormatterToXML.hpp.
|
protected |
Amount to indent.
Definition at line 682 of file FormatterToXML.hpp.
|
protected |
State flag to tell if preservation of whitespace is important.
Definition at line 612 of file FormatterToXML.hpp.
|
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.
|
protected |
The maximum character size before we have to resort to escaping.
Definition at line 597 of file FormatterToXML.hpp.
|
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.
|
protected |
Tell if the next text should be raw.
Definition at line 646 of file FormatterToXML.hpp.
|
protected |
Stack to keep track of whether or not we need to preserve whitespace.
Definition at line 688 of file FormatterToXML.hpp.
|
protected |
If true, XML header should be written to output.
Definition at line 606 of file FormatterToXML.hpp.
|
protected |
Flag to signal that a newline should be added.
Definition at line 622 of file FormatterToXML.hpp.
|
protected |
The stream where the XML will be written.
Definition at line 283 of file FormatterToXML.hpp.
|
protected |
Definition at line 693 of file FormatterToXML.hpp.
|
protected |
If true, cdata sections are simply stripped of their CDATA brackets, without escaping.
Definition at line 641 of file FormatterToXML.hpp.
The writer where the XML will be written.
Definition at line 278 of file FormatterToXML.hpp.
Copyright © 1999-2020 The Apache Software Foundation. All Rights Reserved.
Generated on Tue Oct 10 2023 15:42:13 for Xalan-C++ API Reference by