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  

FormatterToDOM.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(FORMATTERTODOM_HEADER_GUARD_1357924680)
00017 #define FORMATTERTODOM_HEADER_GUARD_1357924680
00018 
00019 
00020 
00021 // Base include file.  Must be first.
00022 #include <xalanc/XMLSupport/XMLSupportDefinitions.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 XALAN_CPP_NAMESPACE_BEGIN
00040 
00041 
00042 
00043 class XalanDocument;
00044 class XalanDocumentFragment;
00045 class XalanElement;
00046 class XalanNode;
00047 
00048 
00049 
00056 class XALAN_XMLSUPPORT_EXPORT FormatterToDOM : public FormatterListener
00057 {
00058 public:
00059 
00060     typedef XalanVector<XalanElement*>      ElementStackType;
00061 
00070     FormatterToDOM(
00071             XalanDocument*          doc,
00072             XalanDocumentFragment*  docFrag,
00073             XalanElement*           currentElement,
00074             MemoryManagerType&      theManager XALAN_DEFAULT_MEMMGR);
00075 
00083     FormatterToDOM(
00084             XalanDocument*          doc,
00085             XalanElement*           elem,
00086             MemoryManagerType&      theManager XALAN_DEFAULT_MEMMGR);
00087 
00088     virtual
00089     ~FormatterToDOM();
00090 
00091 
00092     // These methods are inherited from DocumentHandler ...
00093 
00094     virtual void
00095     charactersRaw(
00096             const XMLCh* const  chars,
00097             const unsigned int  length);
00098 
00099     virtual void
00100     comment(const XMLCh* const  data);
00101 
00102     virtual void
00103     cdata(
00104             const XMLCh* const  ch,
00105             const unsigned int  length);
00106 
00107     virtual void
00108     entityReference(const XMLCh* const  name);
00109 
00110     virtual void
00111     setDocumentLocator(const LocatorType* const     locator);
00112 
00113     virtual void
00114     startDocument();
00115 
00116     virtual void
00117     endDocument();
00118 
00119     virtual void
00120     startElement(
00121                 const   XMLCh* const    name,
00122                 AttributeListType&      attrs);
00123 
00124     virtual void
00125     endElement(const XMLCh* const   name);
00126 
00127     virtual void
00128     characters(
00129                 const XMLCh* const  chars,
00130                 const unsigned int  length);
00131 
00132     virtual void
00133     ignorableWhitespace(
00134                 const XMLCh* const  chars,
00135                 const unsigned int  length);
00136 
00137     virtual void
00138     processingInstruction(
00139             const XMLCh* const  target,
00140             const XMLCh* const  data);
00141 
00142     virtual void
00143     resetDocument();
00144 
00145     XalanDocument*
00146     getDocument() const
00147     {
00148         return m_doc;
00149     }
00150 
00151     void
00152     setDocument(XalanDocument*  theDocument)
00153     {
00154         m_doc = theDocument;
00155     }
00156 
00157     XalanDocumentFragment*
00158     getDocumentFragment() const
00159     {
00160         return m_docFrag;
00161     }
00162 
00163     void
00164     setDocumentFragment(XalanDocumentFragment*  theDocumentFragment)
00165     {
00166         m_docFrag = theDocumentFragment;
00167     }
00168 
00169     XalanElement*
00170     getCurrentElement() const
00171     {
00172         return m_currentElem;
00173     }
00174 
00175     void
00176     setCurrentElement(XalanElement*     theElement)
00177     {
00178         m_currentElem = theElement;
00179     }
00180 
00181 private:
00182 
00186     void
00187     append(XalanNode*   newNode);
00188 
00196     XalanElement*
00197     createElement(
00198             const XalanDOMChar*     theElementName,
00199             AttributeListType&      attrs);
00200 
00201     void
00202     addAttributes(
00203             XalanElement*       theElement,
00204             AttributeListType&  attrs);
00205 
00206 
00207     // Data members...
00208     XalanDocument*                  m_doc;
00209 
00210     XalanDocumentFragment*          m_docFrag;
00211 
00212     XalanElement*                   m_currentElem;
00213 
00214     ElementStackType                m_elemStack;
00215 
00216     XalanDOMString                  m_buffer1;
00217 
00218     XalanDOMString                  m_buffer2;
00219 
00220     static const XalanDOMString     s_emptyString;
00221 };
00222 
00223 
00224 
00225 XALAN_CPP_NAMESPACE_END
00226 
00227 
00228 
00229 #endif  // FORMATTERTODOM_HEADER_GUARD_1357924680

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