## Xalan-C++ API Documentation

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

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

# FormatterToXercesDOM.hpp

Go to the documentation of this file.

    00001 /*
    00002  * Copyright 1999-2004 The Apache Software Foundation.
    00003  *
    00004  * Licensed under the Apache License, Version 2.0 (the "License");
    00005  * you may not use this file except in compliance with the License.
    00006  * You may obtain a copy of the License at
    00007  *
    00008  *     http://www.apache.org/licenses/LICENSE-2.0
    00009  *
    00010  * Unless required by applicable law or agreed to in writing, software
    00011  * distributed under the License is distributed on an "AS IS" BASIS,
    00012  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    00013  * See the License for the specific language governing permissions and
    00014  * limitations under the License.
    00015  */
    00016 #if !defined(FORMATTERTOXERCESDOM_HEADER_GUARD_1357924680)
    00017 #define FORMATTERTOXERCESDOM_HEADER_GUARD_1357924680
    00018
    00019
    00020
    00021 // Base include file.  Must be first.
    00022 #include <xalanc/XercesParserLiaison/XercesParserLiaisonDefinitions.hpp>
    00023
    00024
    00025
    00026 #include <xalanc/Include/XalanVector.hpp>
    00027
    00028
    00029
    00030 // Base class header file.
    00031 #include <xalanc/PlatformSupport/FormatterListener.hpp>
    00032
    00033
    00034
    00035 #include <xalanc/XalanDOM/XalanDOMString.hpp>
    00036
    00037
    00038
    00039 #include <xalanc/XercesParserLiaison/XercesWrapperTypes.hpp>
    00040
    00041
    00042
    00043 XALAN_CPP_NAMESPACE_BEGIN
    00044
    00045
    00046
    00051 class XALAN_XERCESPARSERLIAISON_EXPORT FormatterToXercesDOM : public FormatterListener
    00052 {
    00053 public:
    00054
    00063     FormatterToXercesDOM(
    00064             DOMDocument_Type*           doc,
    00065             DOMDocumentFragmentType*    docFrag,
    00066             DOMElementType*             currentElement,
    00067             MemoryManagerType&          theManager XALAN_DEFAULT_MEMMGR);
    00068
    00076     FormatterToXercesDOM(
    00077             DOMDocument_Type*           doc,
    00078             DOMElementType*             currentElement,
    00079             MemoryManagerType&          theManager XALAN_DEFAULT_MEMMGR);
    00080
    00081     virtual
    00082     ~FormatterToXercesDOM();
    00083
    00084
    00085     // These methods are inherited from DocumentHandler ...
    00086
    00087     virtual void
    00088     charactersRaw(
    00089             const XMLCh* const  chars,
    00090             const unsigned int  length);
    00091
    00092     virtual void
    00093     comment(const XMLCh* const  data);
    00094
    00095     virtual void
    00096     cdata(
    00097             const XMLCh* const  ch,
    00098             const unsigned int  length);
    00099
    00100     virtual void
    00101     entityReference(const XMLCh* const  name);
    00102
    00103     virtual void
    00104     setDocumentLocator(const LocatorType* const     locator);
    00105
    00106     virtual void
    00107     startDocument();
    00108
    00109     virtual void
    00110     endDocument();
    00111
    00112     virtual void
    00113     startElement(
    00114                 const   XMLCh* const    name,
    00115                 AttributeListType&      attrs);
    00116
    00117     virtual void
    00118     endElement(const XMLCh* const   name);
    00119
    00120     virtual void
    00121     characters(
    00122                 const XMLCh* const  chars,
    00123                 const unsigned int  length);
    00124
    00125     virtual void
    00126     ignorableWhitespace(
    00127                 const XMLCh* const  chars,
    00128                 const unsigned int  length);
    00129
    00130     virtual void
    00131     processingInstruction(
    00132             const XMLCh* const  target,
    00133             const XMLCh* const  data);
    00134
    00135     virtual void
    00136     resetDocument();
    00137
    00138     DOMDocument_Type*
    00139     getDocument() const
    00140     {
    00141         return m_doc;
    00142     }
    00143
    00144     void
    00145     setDocument(DOMDocument_Type*   theDocument)
    00146     {
    00147         m_doc = theDocument;
    00148     }
    00149
    00150     DOMDocumentFragmentType*
    00151     getDocumentFragment() const
    00152     {
    00153         return m_docFrag;
    00154     }
    00155
    00156     void
    00157     setDocumentFragment(DOMDocumentFragmentType*    theDocumentFragment)
    00158     {
    00159         m_docFrag = theDocumentFragment;
    00160     }
    00161
    00162     DOMElementType*
    00163     getCurrentElement() const
    00164     {
    00165         return m_currentElem;
    00166     }
    00167
    00168     void
    00169     setCurrentElement(DOMElementType*       theElement)
    00170     {
    00171         m_currentElem = theElement;
    00172     }
    00173
    00174 private:
    00175
    00179     void
    00180     processAccumulatedText();
    00181
    00185     void
    00186     append(DOMNodeType*     newNode);
    00187
    00195     DOMElementType*
    00196     createElement(
    00197             const XalanDOMChar*     theElementName,
    00198             AttributeListType&      attrs);
    00199
    00200     void
    00201     addAttributes(
    00202             DOMElementType*     theElement,
    00203             AttributeListType&  attrs);
    00204
    00205
    00206     // Data members...
    00207     DOMDocument_Type*               m_doc;
    00208
    00209     DOMDocumentFragmentType*        m_docFrag;
    00210
    00211     DOMElementType*                 m_currentElem;
    00212
    00213     typedef XalanVector<DOMElementType*>            ElementStackType;
    00214
    00215     ElementStackType                m_elemStack;
    00216
    00217     XalanDOMString                  m_buffer;
    00218
    00219     XalanDOMString                  m_textBuffer;
    00220
    00221     static const XalanDOMString     s_emptyString;
    00222 };
    00223
    00224
    00225
    00226 XALAN_CPP_NAMESPACE_END
    00227
    00228
    00229
    00230 #endif  // FORMATTERTODOM_HEADER_GUARD_1357924680

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.10 Copyright © 1999-2004 The Apache Software Foundation. All Rights Reserved.