http://xml.apache.org/http://www.apache.org/http://www.w3.org/

Home

Readme
Release Info

Installation
Download
Build

FAQs
Samples
API Docs

DOM C++ Binding
Programming
Migration Guide

Feedback
Bug-Reporting
PDF Document

CVS Repository
Mail Archive

API Docs for SAX and DOM
 

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

DOMBuilder.hpp

Go to the documentation of this file.
00001 #ifndef DOMBuilder_HEADER_GUARD_
00002 #define DOMBuilder_HEADER_GUARD_
00003 
00004 /*
00005  * The Apache Software License, Version 1.1
00006  *
00007  * Copyright (c) 2002 The Apache Software Foundation.  All rights
00008  * reserved.
00009  *
00010  * Redistribution and use in source and binary forms, with or without
00011  * modification, are permitted provided that the following conditions
00012  * are met:
00013  *
00014  * 1. Redistributions of source code must retain the above copyright
00015  *    notice, this list of conditions and the following disclaimer.
00016  *
00017  * 2. Redistributions in binary form must reproduce the above copyright
00018  *    notice, this list of conditions and the following disclaimer in
00019  *    the documentation and/or other materials provided with the
00020  *    distribution.
00021  *
00022  * 3. The end-user documentation included with the redistribution,
00023  *    if any, must include the following acknowledgment:
00024  *       "This product includes software developed by the
00025  *        Apache Software Foundation (http://www.apache.org/)."
00026  *    Alternately, this acknowledgment may appear in the software itself,
00027  *    if and wherever such third-party acknowledgments normally appear.
00028  *
00029  * 4. The names "Xerces" and "Apache Software Foundation" must
00030  *    not be used to endorse or promote products derived from this
00031  *    software without prior written permission. For written
00032  *    permission, please contact apache\@apache.org.
00033  *
00034  * 5. Products derived from this software may not be called "Apache",
00035  *    nor may "Apache" appear in their name, without prior written
00036  *    permission of the Apache Software Foundation.
00037  *
00038  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
00039  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
00040  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
00041  * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
00042  * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
00043  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
00044  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
00045  * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
00046  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
00047  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
00048  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
00049  * SUCH DAMAGE.
00050  * ====================================================================
00051  *
00052  * This software consists of voluntary contributions made by many
00053  * individuals on behalf of the Apache Software Foundation, and was
00054  * originally based on software copyright (c) 2001, International
00055  * Business Machines, Inc., http://www.ibm.com .  For more information
00056  * on the Apache Software Foundation, please see
00057  * <http://www.apache.org/>.
00058  */
00059 
00060 /*
00061  * $Id: DOMBuilder.hpp,v 1.10 2002/12/23 15:23:17 knoaman Exp $
00062  *
00063  */
00064 
00065 
00066 #include <xercesc/util/XercesDefs.hpp>
00067 
00068 XERCES_CPP_NAMESPACE_BEGIN
00069 
00070 
00071 class DOMErrorHandler;
00072 class DOMEntityResolver;
00073 class DOMInputSource;
00074 class DOMBuilderFilter;
00075 class DOMNode;
00076 class DOMDocument;
00077 class Grammar;
00078 
00089 class  DOMBuilder
00090 {
00091 protected :
00092     // -----------------------------------------------------------------------
00093     //  Hidden constructors
00094     // -----------------------------------------------------------------------
00097     DOMBuilder() {};
00098     DOMBuilder(const DOMBuilder &) {};
00099     DOMBuilder & operator = (const DOMBuilder &) {return *this;};
00101 
00102 public:
00103     // -----------------------------------------------------------------------
00104     //  All constructors are hidden, just the destructor is available
00105     // -----------------------------------------------------------------------
00112     virtual ~DOMBuilder() {};
00114 
00115     // -----------------------------------------------------------------------
00116     //  Class types
00117     // -----------------------------------------------------------------------
00147     enum ActionType
00148     {
00149         ACTION_REPLACE            = 1,
00150         ACTION_APPEND_AS_CHILDREN = 2,
00151         ACTION_INSERT_AFTER       = 3,
00152         ACTION_INSERT_BEFORE      = 4
00153     };
00155 
00156     // -----------------------------------------------------------------------
00157     //  Virtual DOMBuilder interface
00158     // -----------------------------------------------------------------------
00161 
00162     // -----------------------------------------------------------------------
00163     //  Getter methods
00164     // -----------------------------------------------------------------------
00165 
00177     virtual DOMErrorHandler* getErrorHandler() = 0;
00178 
00190     virtual const DOMErrorHandler* getErrorHandler() const = 0;
00191 
00203     virtual DOMEntityResolver* getEntityResolver() = 0;
00204 
00216     virtual const DOMEntityResolver* getEntityResolver() const = 0;
00217 
00229     virtual DOMBuilderFilter* getFilter() = 0;
00230 
00242     virtual const DOMBuilderFilter* getFilter() const = 0;
00243 
00244     // -----------------------------------------------------------------------
00245     //  Setter methods
00246     // -----------------------------------------------------------------------
00264     virtual void setErrorHandler(DOMErrorHandler* const handler) = 0;
00265 
00285     virtual void setEntityResolver(DOMEntityResolver* const handler) = 0;
00286 
00308     virtual void setFilter(DOMBuilderFilter* const filter) = 0;
00309 
00310     // -----------------------------------------------------------------------
00311     //  Feature methods
00312     // -----------------------------------------------------------------------
00336     virtual void setFeature(const XMLCh* const name, const bool state) = 0;
00337 
00353     virtual bool getFeature(const XMLCh* const name) const = 0;
00354 
00371     virtual bool canSetFeature(const XMLCh* const name, const bool state) const = 0;
00372 
00373     // -----------------------------------------------------------------------
00374     //  Parsing methods
00375     // -----------------------------------------------------------------------
00406     virtual DOMDocument* parse(const DOMInputSource& source) = 0;
00407 
00435     virtual DOMDocument* parseURI(const XMLCh* const systemId) = 0;
00436 
00463     virtual DOMDocument* parseURI(const char* const systemId) = 0;
00464 
00493     virtual void parseWithContext
00494     (
00495         const   DOMInputSource& source
00496         ,       DOMNode* const contextNode
00497         , const short action
00498     ) = 0;
00500 
00501     // -----------------------------------------------------------------------
00502     //  Non-standard Extension
00503     // -----------------------------------------------------------------------
00506 
00528     virtual void* getProperty(const XMLCh* const name) const = 0 ;
00529 
00551     virtual void setProperty(const XMLCh* const name, void* value) = 0 ;
00552 
00559     virtual void              release() = 0;
00560 
00584     virtual void              resetDocumentPool() = 0;
00585 
00613     virtual Grammar* loadGrammar(const DOMInputSource& source,
00614                                  const short grammarType,
00615                                  const bool toCache = false) = 0;
00616 
00642     virtual Grammar* loadGrammar(const XMLCh* const systemId,
00643                                  const short grammarType,
00644                                  const bool toCache = false) = 0;
00645 
00671     virtual Grammar* loadGrammar(const char* const systemId,
00672                                  const short grammarType,
00673                                  const bool toCache = false) = 0;
00674 
00681     virtual Grammar* getGrammar(const XMLCh* const nameSpaceKey) const = 0;
00682 
00688     virtual Grammar* getRootGrammar() const = 0;
00689 
00696     virtual const XMLCh* getURIText(unsigned int uriId) const = 0;
00697 
00701     virtual void resetCachedGrammarPool() = 0;
00702 
00708     virtual unsigned int getSrcOffset() const = 0;
00709 
00711 
00712 };
00713 
00714 
00715 XERCES_CPP_NAMESPACE_END
00716 
00717 #endif


Copyright © 2000 The Apache Software Foundation. All Rights Reserved.