Xalan-C++ API Documentation

The Xalan C++ XSLT Processor Version 1.10

Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
FormatterToXMLUnicode< UnicodeWriter, ConstantsType, CharPredicate, IndentHandler, XMLVersion > Class Template Reference

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

Inheritance diagram for FormatterToXMLUnicode< UnicodeWriter, ConstantsType, CharPredicate, IndentHandler, XMLVersion >:
XalanXMLSerializerBase FormatterListener

Public Types

enum  { eDefaultIndentAmount = 0 }
typedef UnicodeWriter::value_type value_type
- Public Types inherited from XalanXMLSerializerBase
enum  { eBufferSize = 512 }
enum  {
  eNone = 0u, eAttr = 1u, eBoth = 2u, eForb = 4u,
  eCRFb = 5u
}
typedef XalanVector< bool > BoolStackType
- Public Types inherited from 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
XERCES_CPP_NAMESPACE_QUALIFIER
DocumentHandler 
ParentType
typedef unsigned int size_type

Public Member Functions

 FormatterToXMLUnicode (MemoryManager &theManager, Writer &writer, const XalanDOMString &encoding, const XalanDOMString &doctypeSystem=s_emptyString, const XalanDOMString &doctypePublic=s_emptyString, bool xmlDecl=true, const XalanDOMString &standalone=s_emptyString, size_type indent=eDefaultIndentAmount)
 Constructor.
virtual ~FormatterToXMLUnicode ()
WritergetWriter () const
virtual void endDocument ()
virtual void startElement (const XMLCh *const name, AttributeList &attrs)
virtual void endElement (const XMLCh *const name)
virtual void charactersRaw (const XMLCh *const chars, const unsigned int length)
 Receive notification of character data.
virtual void entityReference (const XMLCh *const name)
 Receive notification of a entityReference.
virtual void comment (const XMLCh *const data)
 Called when a Comment is to be constructed.
virtual const XalanDOMStringgetEncoding () const
- Public Member Functions inherited from XalanXMLSerializerBase
 XalanXMLSerializerBase (MemoryManager &theManager, eXMLVersion theXMLVersion, const XalanDOMString &theEncoding, const XalanDOMString &theDoctypeSystem, const XalanDOMString &theDoctypePublic, bool xmlDecl, const XalanDOMString &theStandalone)
 Constructor.
virtual ~XalanXMLSerializerBase ()
MemoryManagerTypegetMemoryManager ()
virtual void setDocumentLocator (const Locator *const locator)
virtual void startDocument ()
virtual void characters (const XMLCh *const chars, const unsigned int length)
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 cdata (const XMLCh *const ch, const unsigned int length)
 Receive notification of cdata.
virtual const XalanDOMStringgetDoctypeSystem () const
virtual const XalanDOMStringgetDoctypePublic () const
const XalanDOMStringgetVersion () const
const XalanDOMStringgetStandalone () const
bool getShouldWriteXMLHeader () const
void setShouldWriteXMLHeader (bool b)
- Public Member Functions inherited from FormatterListener
 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 PrefixResolvergetPrefixResolver () const
 Get the PrefixResolver for the FormatterListener.
void setPrefixResolver (const PrefixResolver *thePrefixResolver)
 Set the PrefixResolver for the FormatterListener.
virtual const XalanDOMStringgetMediaType () const
virtual int getIndent () const

Static Public Member Functions

static FormatterToXMLUnicodecreate (MemoryManagerType &theManager, Writer &writer, const XalanDOMString &encoding, const XalanDOMString &doctypeSystem=s_emptyString, const XalanDOMString &doctypePublic=s_emptyString, bool xmlDecl=true, const XalanDOMString &standalone=s_emptyString, size_type indent=eDefaultIndentAmount)
- Static Public Member Functions inherited from XalanXMLSerializerBase
static void initialize (MemoryManager &theManager)
 Perform static initialization.
static void terminate ()
 Perform static shut down.

Protected Member Functions

virtual void flushBuffer ()
void writeXMLHeader ()
void writeDoctypeDecl (const XalanDOMChar *name)
void writeProcessingInstruction (const XMLCh *target, const XMLCh *data)
void writeCharacters (const XMLCh *chars, unsigned int length)
void writeCDATA (const XMLCh *chars, unsigned int length)
void outputNewline ()
 Output a line break.
void writeDefaultEscape (XalanDOMChar ch)
 Escape and write a character.
void writeDefaultAttributeEscape (XalanDOMChar ch)
 Escape and write a character in an attribute.
bool writeDefaultEntity (XalanDOMChar ch)
 Handle one of the default entities, return false if it is not a default entity.
bool writeDefaultAttributeEntity (XalanDOMChar ch)
 Handle one of the default entities, return false if it is not a default entity.
void writeParentTagEnd ()
 Check to see if a parent's ">" has been written, and, if it has not, write it.
XalanDOMString::size_type writeNormalizedChar (XalanDOMChar ch, const XalanDOMChar chars[], XalanDOMString::size_type start, XalanDOMString::size_type length)
 Write a normalized character to the stream.
void writeNumericCharacterReference (unsigned long theNumber)
XalanDOMString::size_type writeNormalizedCharBig (const XalanDOMChar chars[], XalanDOMString::size_type start, XalanDOMString::size_type length)
void writeCDATAChars (const XalanDOMChar chars[], XalanDOMString::size_type length, bool &outsideCDATA)
 Write characters for a CDATA section.
void writeAttrString (const XalanDOMChar *theString, XalanDOMString::size_type theStringLength)
 Write an attribute string.
- Protected Member Functions inherited from XalanXMLSerializerBase
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)
- Protected Member Functions inherited from FormatterListener
void setXMLVersion (eXMLVersion theVersion)
 Set the output version during serializing.

Additional Inherited Members

- Static Public Attributes inherited from XalanXMLSerializerBase
static const XalanDOMStrings_1_0String
static const XalanDOMStrings_1_1String
- Static Protected Member Functions inherited from XalanXMLSerializerBase
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 inherited from XalanXMLSerializerBase
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 XalanDOMStringm_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
- Static Protected Attributes inherited from FormatterListener
static const XalanDOMString s_emptyString

Detailed Description

template<class UnicodeWriter, class ConstantsType, class CharPredicate, class IndentHandler, FormatterListener::eXMLVersion XMLVersion>
class FormatterToXMLUnicode< UnicodeWriter, ConstantsType, CharPredicate, IndentHandler, XMLVersion >

FormatterToXMLUnicode formats SAX-style events into XML.

Member Typedef Documentation

template<class UnicodeWriter , class ConstantsType , class CharPredicate , class IndentHandler , FormatterListener::eXMLVersion XMLVersion>
typedef UnicodeWriter::value_type FormatterToXMLUnicode< UnicodeWriter, ConstantsType, CharPredicate, IndentHandler, XMLVersion >::value_type

Member Enumeration Documentation

template<class UnicodeWriter , class ConstantsType , class CharPredicate , class IndentHandler , FormatterListener::eXMLVersion XMLVersion>
anonymous enum
Enumerator:
eDefaultIndentAmount 

Constructor & Destructor Documentation

template<class UnicodeWriter , class ConstantsType , class CharPredicate , class IndentHandler , FormatterListener::eXMLVersion XMLVersion>
FormatterToXMLUnicode< UnicodeWriter, ConstantsType, CharPredicate, IndentHandler, XMLVersion >::FormatterToXMLUnicode ( MemoryManager &  theManager,
Writer writer,
const XalanDOMString encoding,
const XalanDOMString doctypeSystem = s_emptyString,
const XalanDOMString doctypePublic = s_emptyString,
bool  xmlDecl = true,
const XalanDOMString standalone = s_emptyString,
size_type  indent = eDefaultIndentAmount 
)

Constructor.

Parameters
theManagerThe MemoryManager instance to use for all memory allocations
writerthe writer.
versionthe string to write for the XML version number.
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
standaloneThe string the XSLT processor should output for the standalone document declaration
template<class UnicodeWriter , class ConstantsType , class CharPredicate , class IndentHandler , FormatterListener::eXMLVersion XMLVersion>
virtual FormatterToXMLUnicode< UnicodeWriter, ConstantsType, CharPredicate, IndentHandler, XMLVersion >::~FormatterToXMLUnicode ( )
virtual

Member Function Documentation

template<class UnicodeWriter , class ConstantsType , class CharPredicate , class IndentHandler , FormatterListener::eXMLVersion XMLVersion>
virtual void FormatterToXMLUnicode< UnicodeWriter, ConstantsType, CharPredicate, IndentHandler, XMLVersion >::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
charspointer to characters from the XML document
lengthnumber of characters to read from the array
Exceptions
SAXException

Implements XalanXMLSerializerBase.

template<class UnicodeWriter , class ConstantsType , class CharPredicate , class IndentHandler , FormatterListener::eXMLVersion XMLVersion>
virtual void FormatterToXMLUnicode< UnicodeWriter, ConstantsType, CharPredicate, IndentHandler, XMLVersion >::comment ( const XMLCh *const  data)
virtual

Called when a Comment is to be constructed.

Parameters
datapointer to comment data
Exceptions
SAXException

Implements XalanXMLSerializerBase.

template<class UnicodeWriter , class ConstantsType , class CharPredicate , class IndentHandler , FormatterListener::eXMLVersion XMLVersion>
static FormatterToXMLUnicode* FormatterToXMLUnicode< UnicodeWriter, ConstantsType, CharPredicate, IndentHandler, XMLVersion >::create ( MemoryManagerType theManager,
Writer writer,
const XalanDOMString encoding,
const XalanDOMString doctypeSystem = s_emptyString,
const XalanDOMString doctypePublic = s_emptyString,
bool  xmlDecl = true,
const XalanDOMString standalone = s_emptyString,
size_type  indent = eDefaultIndentAmount 
)
static
template<class UnicodeWriter , class ConstantsType , class CharPredicate , class IndentHandler , FormatterListener::eXMLVersion XMLVersion>
virtual void FormatterToXMLUnicode< UnicodeWriter, ConstantsType, CharPredicate, IndentHandler, XMLVersion >::endDocument ( )
virtual

Implements FormatterListener.

template<class UnicodeWriter , class ConstantsType , class CharPredicate , class IndentHandler , FormatterListener::eXMLVersion XMLVersion>
virtual void FormatterToXMLUnicode< UnicodeWriter, ConstantsType, CharPredicate, IndentHandler, XMLVersion >::endElement ( const XMLCh *const  name)
virtual
template<class UnicodeWriter , class ConstantsType , class CharPredicate , class IndentHandler , FormatterListener::eXMLVersion XMLVersion>
virtual void FormatterToXMLUnicode< UnicodeWriter, ConstantsType, CharPredicate, IndentHandler, XMLVersion >::entityReference ( const XMLCh *const  name)
virtual

Receive notification of a entityReference.

Parameters
datapointer to characters from the XML document
Exceptions
SAXException

Implements XalanXMLSerializerBase.

template<class UnicodeWriter , class ConstantsType , class CharPredicate , class IndentHandler , FormatterListener::eXMLVersion XMLVersion>
virtual void FormatterToXMLUnicode< UnicodeWriter, ConstantsType, CharPredicate, IndentHandler, XMLVersion >::flushBuffer ( )
protectedvirtual
template<class UnicodeWriter , class ConstantsType , class CharPredicate , class IndentHandler , FormatterListener::eXMLVersion XMLVersion>
virtual const XalanDOMString& FormatterToXMLUnicode< UnicodeWriter, ConstantsType, CharPredicate, IndentHandler, XMLVersion >::getEncoding ( ) const
virtual
template<class UnicodeWriter , class ConstantsType , class CharPredicate , class IndentHandler , FormatterListener::eXMLVersion XMLVersion>
Writer* FormatterToXMLUnicode< UnicodeWriter, ConstantsType, CharPredicate, IndentHandler, XMLVersion >::getWriter ( ) const
virtual

Reimplemented from FormatterListener.

template<class UnicodeWriter , class ConstantsType , class CharPredicate , class IndentHandler , FormatterListener::eXMLVersion XMLVersion>
void FormatterToXMLUnicode< UnicodeWriter, ConstantsType, CharPredicate, IndentHandler, XMLVersion >::outputNewline ( )
protectedvirtual

Output a line break.

Implements XalanXMLSerializerBase.

template<class UnicodeWriter , class ConstantsType , class CharPredicate , class IndentHandler , FormatterListener::eXMLVersion XMLVersion>
virtual void FormatterToXMLUnicode< UnicodeWriter, ConstantsType, CharPredicate, IndentHandler, XMLVersion >::startElement ( const XMLCh *const  name,
AttributeList &  attrs 
)
virtual
template<class UnicodeWriter , class ConstantsType , class CharPredicate , class IndentHandler , FormatterListener::eXMLVersion XMLVersion>
void FormatterToXMLUnicode< UnicodeWriter, ConstantsType, CharPredicate, IndentHandler, XMLVersion >::writeAttrString ( const XalanDOMChar *  theString,
XalanDOMString::size_type  theStringLength 
)
protected

Write an attribute string.

Parameters
theStringThe string to write.
theStringLengthThe length of the string.
template<class UnicodeWriter , class ConstantsType , class CharPredicate , class IndentHandler , FormatterListener::eXMLVersion XMLVersion>
void FormatterToXMLUnicode< UnicodeWriter, ConstantsType, CharPredicate, IndentHandler, XMLVersion >::writeCDATA ( const XMLCh *  chars,
unsigned int  length 
)
protectedvirtual
template<class UnicodeWriter , class ConstantsType , class CharPredicate , class IndentHandler , FormatterListener::eXMLVersion XMLVersion>
void FormatterToXMLUnicode< UnicodeWriter, ConstantsType, CharPredicate, IndentHandler, XMLVersion >::writeCDATAChars ( const XalanDOMChar  chars[],
XalanDOMString::size_type  length,
bool &  outsideCDATA 
)
protected

Write characters for a CDATA section.

Parameters
chthe string to write.
lengththe length of the string.
template<class UnicodeWriter , class ConstantsType , class CharPredicate , class IndentHandler , FormatterListener::eXMLVersion XMLVersion>
void FormatterToXMLUnicode< UnicodeWriter, ConstantsType, CharPredicate, IndentHandler, XMLVersion >::writeCharacters ( const XMLCh *  chars,
unsigned int  length 
)
protectedvirtual
template<class UnicodeWriter , class ConstantsType , class CharPredicate , class IndentHandler , FormatterListener::eXMLVersion XMLVersion>
bool FormatterToXMLUnicode< UnicodeWriter, ConstantsType, CharPredicate, IndentHandler, XMLVersion >::writeDefaultAttributeEntity ( XalanDOMChar  ch)
protected

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

template<class UnicodeWriter , class ConstantsType , class CharPredicate , class IndentHandler , FormatterListener::eXMLVersion XMLVersion>
void FormatterToXMLUnicode< UnicodeWriter, ConstantsType, CharPredicate, IndentHandler, XMLVersion >::writeDefaultAttributeEscape ( XalanDOMChar  ch)
protected

Escape and write a character in an attribute.

template<class UnicodeWriter , class ConstantsType , class CharPredicate , class IndentHandler , FormatterListener::eXMLVersion XMLVersion>
bool FormatterToXMLUnicode< UnicodeWriter, ConstantsType, CharPredicate, IndentHandler, XMLVersion >::writeDefaultEntity ( XalanDOMChar  ch)
protected

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

template<class UnicodeWriter , class ConstantsType , class CharPredicate , class IndentHandler , FormatterListener::eXMLVersion XMLVersion>
void FormatterToXMLUnicode< UnicodeWriter, ConstantsType, CharPredicate, IndentHandler, XMLVersion >::writeDefaultEscape ( XalanDOMChar  ch)
protected

Escape and write a character.

template<class UnicodeWriter , class ConstantsType , class CharPredicate , class IndentHandler , FormatterListener::eXMLVersion XMLVersion>
void FormatterToXMLUnicode< UnicodeWriter, ConstantsType, CharPredicate, IndentHandler, XMLVersion >::writeDoctypeDecl ( const XalanDOMChar *  name)
protectedvirtual
template<class UnicodeWriter , class ConstantsType , class CharPredicate , class IndentHandler , FormatterListener::eXMLVersion XMLVersion>
XalanDOMString::size_type FormatterToXMLUnicode< UnicodeWriter, ConstantsType, CharPredicate, IndentHandler, XMLVersion >::writeNormalizedChar ( XalanDOMChar  ch,
const XalanDOMChar  chars[],
XalanDOMString::size_type  start,
XalanDOMString::size_type  length 
)
protected

Write a normalized character to the stream.

Parameters
chthe string to write.
startthe start offset into the string.
lengththe length of the string.
template<class UnicodeWriter , class ConstantsType , class CharPredicate , class IndentHandler , FormatterListener::eXMLVersion XMLVersion>
XalanDOMString::size_type FormatterToXMLUnicode< UnicodeWriter, ConstantsType, CharPredicate, IndentHandler, XMLVersion >::writeNormalizedCharBig ( const XalanDOMChar  chars[],
XalanDOMString::size_type  start,
XalanDOMString::size_type  length 
)
protected
template<class UnicodeWriter , class ConstantsType , class CharPredicate , class IndentHandler , FormatterListener::eXMLVersion XMLVersion>
void FormatterToXMLUnicode< UnicodeWriter, ConstantsType, CharPredicate, IndentHandler, XMLVersion >::writeNumericCharacterReference ( unsigned long  theNumber)
protected
template<class UnicodeWriter , class ConstantsType , class CharPredicate , class IndentHandler , FormatterListener::eXMLVersion XMLVersion>
void FormatterToXMLUnicode< UnicodeWriter, ConstantsType, CharPredicate, IndentHandler, XMLVersion >::writeParentTagEnd ( )
protected

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

template<class UnicodeWriter , class ConstantsType , class CharPredicate , class IndentHandler , FormatterListener::eXMLVersion XMLVersion>
void FormatterToXMLUnicode< UnicodeWriter, ConstantsType, CharPredicate, IndentHandler, XMLVersion >::writeProcessingInstruction ( const XMLCh *  target,
const XMLCh *  data 
)
protectedvirtual
template<class UnicodeWriter , class ConstantsType , class CharPredicate , class IndentHandler , FormatterListener::eXMLVersion XMLVersion>
void FormatterToXMLUnicode< UnicodeWriter, ConstantsType, CharPredicate, IndentHandler, XMLVersion >::writeXMLHeader ( )
protectedvirtual

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