## Xalan-C++ API Documentation

### The Xalan C++ XSLT Processor Version 1.6

Main Page Class Hierarchy Alphabetical List Compound List File List Compound Members File Members

# FormatterToXML_UTF16 Class Reference

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

`#include <FormatterToXML_UTF16.hpp>`

Inheritance diagram for FormatterToXML_UTF16

Collaboration diagram for FormatterToXML_UTF16:

List of all members.

## Public Types

- typedef std::vector<bool> BoolStackType

## Public Methods

- FormatterToXML_UTF16 ( Writer& writer, const XalanDOMString& version = XalanDOMString(), const XalanDOMString& mediaType = XalanDOMString(), const XalanDOMString& doctypeSystem = XalanDOMString(), const XalanDOMString& doctypePublic = XalanDOMString(), bool xmlDecl = true, const XalanDOMString& standalone = XalanDOMString())
    Constructor. More...
- virtual ~FormatterToXML_UTF16 ()
- virtual void setDocumentLocator (const LocatorType* const locator)
- virtual void startDocument ()
- virtual void endDocument ()
- virtual void startElement ( const XMLCh* const name, AttributeListType& 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)
- 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)
- virtual Writer* getWriter () const
- virtual const XalanDOMString& getDoctypeSystem () const
- virtual const XalanDOMString& getDoctypePublic () const
- virtual const XalanDOMString& getEncoding () const
- virtual const XalanDOMString& getMediaType () const
- const XalanDOMString& getVersion () const
- const XalanDOMString& getStandalone () const
- bool getShouldWriteXMLHeader () const
- void setShouldWriteXMLHeader (bool b)

## Static Public Methods

- void initialize ()
    Perform static initialization. More...
- void terminate ()
    Perform static shut down. More...

## Protected Methods

- void outputLineSep ()
    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 writeCommentData (const XalanDOMChar* data)
    Write the data for a comment. More...
- void flushWriter ()
- void openElementForChildren ()
- bool childNodesWereAdded ()
- void writeParentTagEnd ()
    Check to see if a parent's ">" has been written, and, if it has not, write it.
- void writeNormalizedChar (XalanDOMChar ch)
    Write a normalized character to the stream. More...
- void writeCDATAChars ( const XalanDOMChar ch[], XalanDOMString::size_type length)
    Write characters for a CDATA section. More...
- void writeAttrString ( const XalanDOMChar* theString, XalanDOMString::size_type theStringLength)
    Write an attribute string. More...

## Protected Attributes

- Writer* m_writer
    The writer.
- bool m_shouldWriteXMLHeader
    If true, XML header should be written to output.
- 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_nextIsRaw
    Tell if the next text should be raw.
- const XalanDOMString m_doctypeSystem
    The System ID for the doc type.
- const XalanDOMString m_doctypePublic
    The public ID for the doc type.

## Static Protected Methods

- void throwInvalidUTF16SurrogateException (XalanDOMChar ch)
    Throw an exception when an invalid surrogate is encountered. More...
- void throwInvalidUTF16SurrogateException ( XalanDOMChar ch, XalanDOMChar next)
    Throw an exception when an invalid surrogate is encountered. More...

## Detailed Description

FormatterToXML_UTF16 formats SAX-style events into XML.

## Member Typedef Documentation

typedef std::vector<bool> FormatterToXML_UTF16::BoolStackType

## Constructor & Destructor Documentation

FormatterToXML_UTF16::FormatterToXML_UTF16 ( | Writer & writer,
| const XalanDOMString & version = XalanDOMString(),
| const XalanDOMString & mediaType = XalanDOMString(),
| const XalanDOMString & doctypeSystem = XalanDOMString(),
| const XalanDOMString & doctypePublic = XalanDOMString(),
| bool xmlDecl = true,
| const XalanDOMString & standalone = XalanDOMString() )

Constructor.

Parameters:

  writer | the writer.
  version | the string to write for the XML version number.
  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 | The string the XSLT processor should output for the standalone document declaration

virtual FormatterToXML_UTF16::~FormatterToXML_UTF16 ( | )`[virtual]`

## Member Function Documentation

virtual void FormatterToXML_UTF16::cdata ( | const XMLCh *const ch,
| const unsigned int length )`[virtual]`

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

virtual void FormatterToXML_UTF16::charactersRaw ( | const XMLCh *const chars,
| const unsigned int length )`[virtual]`

bool FormatterToXML_UTF16::childNodesWereAdded ( | )`[protected]`

virtual void FormatterToXML_UTF16::comment ( | const XMLCh *const data )`[virtual]`

Called when a Comment is to be constructed.

Parameters:

  data | pointer to comment data

Exceptions:

  SAXException |

Reimplemented from FormatterListener.

virtual void FormatterToXML_UTF16::endDocument ( | )`[virtual]`

Reimplemented from FormatterListener.

virtual void FormatterToXML_UTF16::endElement ( | const XMLCh *const name )`[virtual]`

Reimplemented from FormatterListener.

virtual void FormatterToXML_UTF16::entityReference ( | const XMLCh *const name )`[virtual]`

Receive notification of a entityReference.

Parameters:

  data | pointer to characters from the XML document

Exceptions:

  SAXException |

Reimplemented from FormatterListener.

void FormatterToXML_UTF16::flushWriter ( | )`[protected]`

virtual const XalanDOMString& FormatterToXML_UTF16::getDoctypePublic ( | ) const`[virtual]`

Reimplemented from FormatterListener.

virtual const XalanDOMString& FormatterToXML_UTF16::getDoctypeSystem ( | ) const`[virtual]`

Reimplemented from FormatterListener.

virtual const XalanDOMString& FormatterToXML_UTF16::getEncoding ( | ) const`[virtual]`

Reimplemented from FormatterListener.

virtual const XalanDOMString& FormatterToXML_UTF16::getMediaType ( | ) const`[virtual]`

Reimplemented from FormatterListener.

bool FormatterToXML_UTF16::getShouldWriteXMLHeader ( | ) const`[]`

const XalanDOMString & FormatterToXML_UTF16::getStandalone ( | ) const`[]`

const XalanDOMString & FormatterToXML_UTF16::getVersion ( | ) const`[]`

virtual Writer* FormatterToXML_UTF16::getWriter ( | ) const`[virtual]`

Reimplemented from FormatterListener.

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

void FormatterToXML_UTF16::initialize ( | )`[static]`

Perform static initialization.

See class XMLSupportInit.

void FormatterToXML_UTF16::openElementForChildren ( | )`[protected]`

void FormatterToXML_UTF16::outputLineSep ( | )`[protected]`

Output a line break.

virtual void FormatterToXML_UTF16::processingInstruction ( | const XMLCh *const target,
| const XMLCh *const data )`[virtual]`

Reimplemented from FormatterListener.

virtual void FormatterToXML_UTF16::resetDocument ( | )`[virtual]`

Reimplemented from FormatterListener.

virtual void FormatterToXML_UTF16::setDocumentLocator ( | const LocatorType *const locator )`[virtual]`

Reimplemented from FormatterListener.

void FormatterToXML_UTF16::setShouldWriteXMLHeader ( | bool b )`[]`

virtual void FormatterToXML_UTF16::startDocument ( | )`[virtual]`

Reimplemented from FormatterListener.

virtual void FormatterToXML_UTF16::startElement ( | const XMLCh *const name,
| AttributeListType & attrs )`[virtual]`

Reimplemented from FormatterListener.

void FormatterToXML_UTF16::terminate ( | )`[static]`

Perform static shut down.

See class XMLSupportInit.

void FormatterToXML_UTF16::throwInvalidUTF16SurrogateException ( | XalanDOMChar ch,
| XalanDOMChar 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_UTF16::throwInvalidUTF16SurrogateException ( | XalanDOMChar ch )`[static, protected]`

Throw an exception when an invalid surrogate is encountered.

Parameters:

  ch | The first character in the surrogate

void FormatterToXML_UTF16::writeAttrString ( | const XalanDOMChar * theString,
| XalanDOMString::size_type theStringLength )`[protected]`

Write an attribute string.

Parameters:

  theString | The string to write.
  theStringLength | The length of the string.

void FormatterToXML_UTF16::writeCDATAChars ( | const XalanDOMChar ch[],
| XalanDOMString::size_type length )`[protected]`

Write characters for a CDATA section.

Parameters:

  ch | the string to write.
  length | the length of the string.

void FormatterToXML_UTF16::writeCommentData ( | const XalanDOMChar * data )`[protected]`

Write the data for a comment.

Parameters:

  data | The comment's data.

bool FormatterToXML_UTF16::writeDefaultAttributeEntity ( | XalanDOMChar ch )`[protected]`

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

void FormatterToXML_UTF16::writeDefaultAttributeEscape ( | XalanDOMChar ch )`[protected]`

Escape and write a character in an attribute.

bool FormatterToXML_UTF16::writeDefaultEntity ( | XalanDOMChar ch )`[protected]`

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

void FormatterToXML_UTF16::writeDefaultEscape ( | XalanDOMChar ch )`[protected]`

Escape and write a character.

void FormatterToXML_UTF16::writeNormalizedChar ( | XalanDOMChar ch )`[protected]`

Write a normalized character to the stream.

Parameters:

  ch | the character to write

void FormatterToXML_UTF16::writeParentTagEnd ( | )`[protected]`

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

## Member Data Documentation

const XalanDOMString FormatterToXML_UTF16::m_doctypePublic`[protected]`

The public ID for the doc type.

const XalanDOMString FormatterToXML_UTF16::m_doctypeSystem`[protected]`

The System ID for the doc type.

bool FormatterToXML_UTF16::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_UTF16::m_nextIsRaw`[protected]`

Tell if the next text should be raw.

bool FormatterToXML_UTF16::m_shouldWriteXMLHeader`[protected]`

If true, XML header should be written to output.

Writer * FormatterToXML_UTF16::m_writer`[protected]`

The writer.

The documentation for this class was generated from the following file:

- FormatterToXML_UTF16.hpp

Interpreting class diagrams

Doxygen and GraphViz are used to generate this API documentation from the Xalan-C header files.

Xalan-C++ XSLT Processor Version 1.6 Copyright © 2000, 2001, 2002, 2003 The Apache Software Foundation. All Rights Reserved.