XalanXMLSerializerBase serves as a base class for XML serializers based on FormatterListener events. More...
Classes | |
class | CharFunctor1_0 |
class | CharFunctor1_1 |
class | UTF16 |
class | UTF8 |
Public Types | |
enum | { eBufferSize = 512 } |
enum | { eNone = 0u, eAttr = 1u, eBoth = 2u, eForb = 4u, eCRFb = 5u } |
typedef XalanVector< bool > | BoolStackType |
![]() | |
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 XERCES_CPP_NAMESPACE_QUALIFIER DocumentHandler | ParentType |
typedef unsigned int | size_type |
Public Member Functions | |
XalanXMLSerializerBase (MemoryManager &theManager, eXMLVersion theXMLVersion, const XalanDOMString &theEncoding, const XalanDOMString &theDoctypeSystem, const XalanDOMString &theDoctypePublic, bool xmlDecl, const XalanDOMString &theStandalone) | |
Constructor. | |
virtual | ~XalanXMLSerializerBase () |
MemoryManagerType & | getMemoryManager () |
virtual void | setDocumentLocator (const Locator *const locator) |
virtual void | startDocument () |
virtual void | startElement (const XMLCh *const name, AttributeList &attrs)=0 |
virtual void | endElement (const XMLCh *const name)=0 |
virtual void | characters (const XMLCh *const chars, const unsigned int length) |
virtual void | charactersRaw (const XMLCh *const chars, const unsigned int length)=0 |
Receive notification of character data. | |
virtual void | entityReference (const XMLCh *const name)=0 |
Receive notification of a entityReference. | |
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)=0 |
Called when a Comment is to be constructed. | |
virtual void | cdata (const XMLCh *const ch, const unsigned int length) |
Receive notification of cdata. | |
virtual const XalanDOMString & | getDoctypeSystem () const |
virtual const XalanDOMString & | getDoctypePublic () const |
virtual const XalanDOMString & | getEncoding () const =0 |
const XalanDOMString & | getVersion () const |
const XalanDOMString & | getStandalone () const |
bool | getShouldWriteXMLHeader () const |
void | setShouldWriteXMLHeader (bool b) |
![]() | |
FormatterListener (eFormat theFormat) | |
virtual | ~FormatterListener () |
eFormat | getOutputFormat () const |
Get the output format for the instance. | |
eXMLVersion | getXMLVersion () const |
Get the version of XML the FormatterListener is generating. | |
bool | isXML1_1Version () const |
Determine if the version of XML output is 1.1. | |
const PrefixResolver * | getPrefixResolver () const |
Get the PrefixResolver for the FormatterListener. | |
void | setPrefixResolver (const PrefixResolver *thePrefixResolver) |
Set the PrefixResolver for the FormatterListener. | |
virtual void | endDocument ()=0 |
virtual Writer * | getWriter () const |
virtual const XalanDOMString & | getMediaType () const |
virtual int | getIndent () const |
Static Public Member Functions | |
static void | initialize (MemoryManager &theManager) |
Perform static initialization. | |
static void | terminate () |
Perform static shut down. |
Static Public Attributes | |
static const XalanDOMString & | s_1_0String |
static const XalanDOMString & | s_1_1String |
![]() | |
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 | |
virtual void | writeXMLHeader ()=0 |
virtual void | flushBuffer ()=0 |
virtual void | writeDoctypeDecl (const XalanDOMChar *name)=0 |
virtual void | writeProcessingInstruction (const XMLCh *target, const XMLCh *data)=0 |
virtual void | writeCharacters (const XMLCh *chars, unsigned int length)=0 |
virtual void | writeCDATA (const XMLCh *chars, unsigned int length)=0 |
virtual void | outputNewline ()=0 |
bool | markParentForChildren () |
Mark the parent element as having a child. | |
bool | getNeedToOutputDoctypeDecl () const |
Determine if it a DOCTYPE declaration needs to be written. | |
void | openElementForChildren () |
Open an element for possibile children. | |
bool | outsideDocumentElement () const |
bool | childNodesWereAdded () |
Determine if an element ever had any children added. | |
void | generateDoctypeDecl (const XalanDOMChar *name) |
![]() | |
void | setXMLVersion (eXMLVersion theVersion) |
Set the output version during serializing. |
Static Protected Member Functions | |
static bool | isUTF16HighSurrogate (XalanDOMChar theChar) |
static bool | isUTF16LowSurrogate (XalanDOMChar theChar) |
static unsigned int | decodeUTF16SurrogatePair (XalanDOMChar theHighSurrogate, XalanDOMChar theLowSurrogate, MemoryManager &theManager) |
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 (unsigned int ch, MemoryManager &theManager) |
Throw an exception when an invalid character is encountered. | |
static void | throwInvalidXMLCharacterException (unsigned int ch, const XalanDOMString &theXMLversion, MemoryManager &theManager) |
Throw an exception when an invalid character for the specific XML version is encountered. |
Protected Attributes | |
bool | m_nextIsRaw |
Tell if the next text should be raw. | |
bool | m_spaceBeforeClose |
Add space before '/>' for XHTML. | |
const XalanDOMString | m_doctypeSystem |
The System ID for the doc type. | |
const XalanDOMString | m_doctypePublic |
The public ID for the doc type. | |
const XalanDOMString & | m_version |
Tells the XML version, for writing out to the XML decl. | |
const XalanDOMString | m_standalone |
Text for standalone part of header. | |
const XalanDOMString | m_encoding |
![]() | |
const PrefixResolver * | m_prefixResolver |
Additional Inherited Members | |
![]() | |
static const XalanDOMString | s_emptyString |
XalanXMLSerializerBase serves as a base class for XML serializers based on FormatterListener events.
typedef XalanVector<bool> XalanXMLSerializerBase::BoolStackType |
XalanXMLSerializerBase::XalanXMLSerializerBase | ( | MemoryManager & | theManager, |
eXMLVersion | theXMLVersion, | ||
const XalanDOMString & | theEncoding, | ||
const XalanDOMString & | theDoctypeSystem, | ||
const XalanDOMString & | theDoctypePublic, | ||
bool | xmlDecl, | ||
const XalanDOMString & | theStandalone | ||
) |
Constructor.
theManager | The MemoryManager instance to use for any memory allocations |
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 |
theStandalone | The string the XSLT processor should output for the standalone document declaration |
|
virtual |
|
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).
ch | pointer to characters from the XML document |
length | number of characters to read from the array |
SAXException |
Implements FormatterListener.
|
virtual |
Implements FormatterListener.
|
pure virtual |
Receive notification of character data.
If available, when the disable-output-escaping attribute is used, output raw text without escaping.
chars | pointer to characters from the XML document |
length | number of characters to read from the array |
SAXException |
Implements FormatterListener.
Implemented in FormatterToXMLUnicode< UnicodeWriter, ConstantsType, CharPredicate, IndentHandler, XMLVersion >.
|
protected |
Determine if an element ever had any children added.
|
pure virtual |
Called when a Comment is to be constructed.
data | pointer to comment data |
SAXException |
Implements FormatterListener.
Implemented in FormatterToXMLUnicode< UnicodeWriter, ConstantsType, CharPredicate, IndentHandler, XMLVersion >.
|
staticprotected |
|
pure virtual |
Implements FormatterListener.
Implemented in FormatterToXMLUnicode< UnicodeWriter, ConstantsType, CharPredicate, IndentHandler, XMLVersion >.
|
pure virtual |
Receive notification of a entityReference.
data | pointer to characters from the XML document |
SAXException |
Implements FormatterListener.
Implemented in FormatterToXMLUnicode< UnicodeWriter, ConstantsType, CharPredicate, IndentHandler, XMLVersion >.
|
protectedpure virtual |
|
protected |
|
virtual |
Reimplemented from FormatterListener.
|
virtual |
Reimplemented from FormatterListener.
|
pure virtual |
Reimplemented from FormatterListener.
Implemented in FormatterToXMLUnicode< UnicodeWriter, ConstantsType, CharPredicate, IndentHandler, XMLVersion >.
MemoryManagerType& XalanXMLSerializerBase::getMemoryManager | ( | ) |
|
protected |
Determine if it a DOCTYPE declaration needs to be written.
bool XalanXMLSerializerBase::getShouldWriteXMLHeader | ( | ) | const |
const XalanDOMString& XalanXMLSerializerBase::getStandalone | ( | ) | const |
const XalanDOMString& XalanXMLSerializerBase::getVersion | ( | ) | const |
|
virtual |
Implements FormatterListener.
|
static |
Perform static initialization.
See class XMLSupportInit.
|
staticprotected |
|
staticprotected |
|
protected |
Mark the parent element as having a child.
If this is the first child, return true, otherwise, return false. This allows the child element to determine if the parent tag has already been closed.
|
protected |
Open an element for possibile children.
|
protectedpure virtual |
|
protected |
|
virtual |
Implements FormatterListener.
|
virtual |
Implements FormatterListener.
|
virtual |
Implements FormatterListener.
void XalanXMLSerializerBase::setShouldWriteXMLHeader | ( | bool | b | ) |
|
virtual |
Implements FormatterListener.
|
pure virtual |
Implements FormatterListener.
Implemented in FormatterToXMLUnicode< UnicodeWriter, ConstantsType, CharPredicate, IndentHandler, XMLVersion >.
|
static |
Perform static shut down.
See class XMLSupportInit.
|
staticprotected |
Throw an exception when an invalid 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 |
|
staticprotected |
Throw an exception when an invalid surrogate is encountered.
ch | The first character in the surrogate |
next | The next character in the surrogate |
|
staticprotected |
Throw an exception when an invalid character for the specific XML version is encountered.
ch | The first character in the surrogate |
next | The next character in the surrogate |
|
protectedpure virtual |
|
protectedpure virtual |
|
protectedpure virtual |
|
protectedpure virtual |
|
protectedpure virtual |
|
protected |
The public ID for the doc type.
|
protected |
The System ID for the doc type.
|
protected |
|
protected |
Tell if the next text should be raw.
|
protected |
Add space before '/>' for XHTML.
|
protected |
Text for standalone part of header.
|
protected |
Tells the XML version, for writing out to the XML decl.
|
static |
|
static |
Doxygen and GraphViz are used to generate this API documentation from the Xalan-C header files.
![]() |
Xalan-C++ XSLT Processor Version 1.10 |
|