Xalan-C++ API Documentation

The Xalan C++ XSLT Processor Version 1.8

Main Page | Directories | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

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 <vector>
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 
00075     FormatterToXercesDOM(
00076             DOMDocument_Type*           doc,
00077             DOMElementType*             currentElement);
00078 
00079     virtual
00080     ~FormatterToXercesDOM();
00081 
00082 
00083     // These methods are inherited from DocumentHandler ...
00084 
00085     virtual void
00086     charactersRaw(
00087             const XMLCh* const  chars,
00088             const unsigned int  length);
00089 
00090     virtual void
00091     comment(const XMLCh* const  data);
00092 
00093     virtual void
00094     cdata(
00095             const XMLCh* const  ch,
00096             const unsigned int  length);
00097 
00098     virtual void
00099     entityReference(const XMLCh* const  name);
00100 
00101     virtual void
00102     setDocumentLocator(const LocatorType* const     locator);
00103 
00104     virtual void
00105     startDocument();
00106 
00107     virtual void
00108     endDocument();
00109 
00110     virtual void
00111     startElement(
00112                 const   XMLCh* const    name,
00113                 AttributeListType&      attrs);
00114 
00115     virtual void
00116     endElement(const XMLCh* const   name);
00117 
00118     virtual void
00119     characters(
00120                 const XMLCh* const  chars,
00121                 const unsigned int  length);
00122 
00123     virtual void
00124     ignorableWhitespace(
00125                 const XMLCh* const  chars,
00126                 const unsigned int  length);
00127 
00128     virtual void
00129     processingInstruction(
00130             const XMLCh* const  target,
00131             const XMLCh* const  data);
00132 
00133     virtual void
00134     resetDocument();
00135 
00136     DOMDocument_Type*
00137     getDocument() const
00138     {
00139         return m_doc;
00140     }
00141 
00142     void
00143     setDocument(DOMDocument_Type*   theDocument)
00144     {
00145         m_doc = theDocument;
00146     }
00147 
00148     DOMDocumentFragmentType*
00149     getDocumentFragment() const
00150     {
00151         return m_docFrag;
00152     }
00153 
00154     void
00155     setDocumentFragment(DOMDocumentFragmentType*    theDocumentFragment)
00156     {
00157         m_docFrag = theDocumentFragment;
00158     }
00159 
00160     DOMElementType*
00161     getCurrentElement() const
00162     {
00163         return m_currentElem;
00164     }
00165 
00166     void
00167     setCurrentElement(DOMElementType*       theElement)
00168     {
00169         m_currentElem = theElement;
00170     }
00171 
00172 private:
00173 
00177     void
00178     processAccumulatedText();
00179 
00183     void
00184     append(DOMNodeType*     newNode);
00185 
00193     DOMElementType*
00194     createElement(
00195             const XalanDOMChar*     theElementName,
00196             AttributeListType&      attrs);
00197 
00198     void
00199     addAttributes(
00200             DOMElementType*     theElement,
00201             AttributeListType&  attrs);
00202 
00203 
00204     // Data members...
00205     DOMDocument_Type*               m_doc;
00206 
00207     DOMDocumentFragmentType*        m_docFrag;
00208 
00209     DOMElementType*                 m_currentElem;
00210 
00211 #if defined(XALAN_NO_STD_NAMESPACE)
00212     typedef vector<DOMElementType*>         ElementStackType;
00213 #else
00214     typedef std::vector<DOMElementType*>    ElementStackType;
00215 #endif
00216 
00217     ElementStackType                m_elemStack;
00218 
00219     XalanDOMString                  m_buffer;
00220 
00221     XalanDOMString                  m_textBuffer;
00222 
00223     static const XalanDOMString     s_emptyString;
00224 };
00225 
00226 
00227 
00228 XALAN_CPP_NAMESPACE_END
00229 
00230 
00231 
00232 #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.8
Copyright © 1999-2004 The Apache Software Foundation. All Rights Reserved.