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

Home

Readme
Download
Installation
Build

API Docs
Samples
Schema

FAQs
Programming
Migration

Releases
Bug-Reporting
Feedback

Y2K Compliance
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  

DOM_Node.hpp

Go to the documentation of this file.
00001 /*
00002  * The Apache Software License, Version 1.1
00003  *
00004  * Copyright (c) 1999-2002 The Apache Software Foundation.  All rights
00005  * reserved.
00006  *
00007  * Redistribution and use in source and binary forms, with or without
00008  * modification, are permitted provided that the following conditions
00009  * are met:
00010  *
00011  * 1. Redistributions of source code must retain the above copyright
00012  *    notice, this list of conditions and the following disclaimer.
00013  *
00014  * 2. Redistributions in binary form must reproduce the above copyright
00015  *    notice, this list of conditions and the following disclaimer in
00016  *    the documentation and/or other materials provided with the
00017  *    distribution.
00018  *
00019  * 3. The end-user documentation included with the redistribution,
00020  *    if any, must include the following acknowledgment:
00021  *       "This product includes software developed by the
00022  *        Apache Software Foundation (http://www.apache.org/)."
00023  *    Alternately, this acknowledgment may appear in the software itself,
00024  *    if and wherever such third-party acknowledgments normally appear.
00025  *
00026  * 4. The names "Xerces" and "Apache Software Foundation" must
00027  *    not be used to endorse or promote products derived from this
00028  *    software without prior written permission. For written
00029  *    permission, please contact apache\@apache.org.
00030  *
00031  * 5. Products derived from this software may not be called "Apache",
00032  *    nor may "Apache" appear in their name, without prior written
00033  *    permission of the Apache Software Foundation.
00034  *
00035  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
00036  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
00037  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
00038  * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
00039  * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
00040  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
00041  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
00042  * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
00043  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
00044  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
00045  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
00046  * SUCH DAMAGE.
00047  * ====================================================================
00048  *
00049  * This software consists of voluntary contributions made by many
00050  * individuals on behalf of the Apache Software Foundation, and was
00051  * originally based on software copyright (c) 1999, International
00052  * Business Machines, Inc., http://www.ibm.com .  For more information
00053  * on the Apache Software Foundation, please see
00054  * <http://www.apache.org/>.
00055  */
00056 
00057 /*
00058  * $Id: DOM_Node.hpp,v 1.3 2002/02/20 18:17:00 tng Exp $
00059  */
00060 
00061 #ifndef DOM_Node_HEADER_GUARD_
00062 #define DOM_Node_HEADER_GUARD_
00063 
00064 #include <xercesc/util/XercesDefs.hpp>
00065 #include <xercesc/dom/DOMString.hpp>
00066 
00067 class DOM_NodeList;
00068 class DOM_NamedNodeMap;
00069 class DOM_Document;
00070 class NodeImpl;
00071 
00072 class DOM_NullPtr;  // A dummy class, with no implementation, that is
00073                     //  used as in overloaded functions as a way to
00074                     //  pass 0 or null.
00075 
00095 class   DOM_Node {
00096 
00097     public:
00100 
00108     DOM_Node();
00109 
00115     DOM_Node(const DOM_Node &other);
00116 
00122     DOM_Node & operator = (const DOM_Node &other);
00123 
00137     DOM_Node & operator = (const DOM_NullPtr *val);
00138 
00140 
00142 
00147     ~DOM_Node();
00148 
00150 
00152 
00163     bool operator == (const DOM_Node & other)const;
00164 
00170     bool operator == (const DOM_NullPtr *other) const;
00171 
00176     bool operator != (const DOM_Node & other) const;
00177 
00183    bool operator != (const DOM_NullPtr * other) const;
00184 
00185 
00186     enum NodeType {
00187         ELEMENT_NODE                = 1,
00188         ATTRIBUTE_NODE              = 2,
00189         TEXT_NODE                   = 3,
00190         CDATA_SECTION_NODE          = 4,
00191         ENTITY_REFERENCE_NODE       = 5,
00192         ENTITY_NODE                 = 6,
00193         PROCESSING_INSTRUCTION_NODE = 7,
00194         COMMENT_NODE                = 8,
00195         DOCUMENT_NODE               = 9,
00196         DOCUMENT_TYPE_NODE          = 10,
00197         DOCUMENT_FRAGMENT_NODE      = 11,
00198         NOTATION_NODE               = 12,
00199         XML_DECL_NODE               = 13
00200     };
00201 
00203 
00205 
00209     DOMString       getNodeName() const;
00210 
00221     DOMString       getNodeValue() const;
00222 
00226     short           getNodeType() const;
00227 
00237     DOM_Node        getParentNode() const;
00238 
00252     DOM_NodeList    getChildNodes() const;
00258     DOM_Node        getFirstChild() const;
00259 
00265     DOM_Node        getLastChild() const;
00266 
00272     DOM_Node        getPreviousSibling() const;
00273 
00279     DOM_Node        getNextSibling() const;
00280 
00285     DOM_NamedNodeMap  getAttributes() const;
00286 
00297     DOM_Document      getOwnerDocument() const;
00298 
00307     void              *getUserData() const;
00308 
00310 
00312 
00331     DOM_Node         cloneNode(bool deep) const;
00332 
00334 
00336 
00363     DOM_Node               insertBefore(const DOM_Node &newChild,
00364                                         const DOM_Node &refChild);
00365 
00366 
00389     DOM_Node       replaceChild(const DOM_Node &newChild,
00390                                 const DOM_Node &oldChild);
00402     DOM_Node        removeChild(const DOM_Node &oldChild);
00403 
00423     DOM_Node        appendChild(const DOM_Node &newChild);
00424 
00426 
00428 
00436     bool             hasChildNodes() const;
00437 
00438 
00451     bool                    isNull() const;
00452 
00454 
00456 
00457 
00471     void              setNodeValue(const DOMString &nodeValue);
00472 
00490     void              setUserData(void *p);
00491 
00493 
00495 
00515     void              normalize();
00516 
00531     bool              isSupported(const DOMString &feature,
00532                            const DOMString &version) const;
00533 
00548     DOMString         getNamespaceURI() const;
00549 
00555     DOMString         getPrefix() const;
00556 
00565     DOMString         getLocalName() const;
00566 
00598     void              setPrefix(const DOMString &prefix);
00599 
00605     bool              hasAttributes() const;
00606 
00608 
00609 protected:
00610     NodeImpl   *fImpl;
00611 
00612     DOM_Node(NodeImpl *);
00613 
00614     friend class DOM_Document;
00615     friend class DocumentImpl;
00616     friend class TreeWalkerImpl;
00617     friend class NodeIteratorImpl;
00618     friend class DOM_NamedNodeMap;
00619     friend class DOM_NodeList;
00620     friend class DOMParser;
00621     friend class DOM_Entity;
00622     friend class RangeImpl;
00623     friend class CharacterDataImpl;
00624     friend class XUtil;
00625 
00626 };
00627 
00628 
00629 #endif
00630 


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