You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by jp...@locus.apache.org on 2000/07/06 01:16:15 UTC

cvs commit: xml-xerces/c/src/dom AttrMapImpl.cpp AttrMapImpl.hpp DocumentTypeImpl.cpp DocumentTypeImpl.hpp ElementImpl.cpp ElementImpl.hpp Makefile.in NamedNodeMapImpl.cpp NamedNodeMapImpl.hpp

jpolast     00/07/05 16:16:15

  Modified:    c/src/dom DocumentTypeImpl.cpp DocumentTypeImpl.hpp
                        ElementImpl.cpp ElementImpl.hpp Makefile.in
                        NamedNodeMapImpl.cpp NamedNodeMapImpl.hpp
  Added:       c/src/dom AttrMapImpl.cpp AttrMapImpl.hpp
  Log:
  use AttrMapImpl for attributes instead of NamedNodeMapImpl
  default attribute values kept as per dom spec
    create elements after parse has default attributes
    remove attribute replaces default value if available
  
  Revision  Changes    Path
  1.20      +14 -3     xml-xerces/c/src/dom/DocumentTypeImpl.cpp
  
  Index: DocumentTypeImpl.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/dom/DocumentTypeImpl.cpp,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- DocumentTypeImpl.cpp	2000/05/02 19:22:01	1.19
  +++ DocumentTypeImpl.cpp	2000/07/05 23:16:10	1.20
  @@ -55,7 +55,7 @@
    */
   
   /*
  - * $Id: DocumentTypeImpl.cpp,v 1.19 2000/05/02 19:22:01 aruna1 Exp $
  + * $Id: DocumentTypeImpl.cpp,v 1.20 2000/07/05 23:16:10 jpolast Exp $
    */
   
   #include "DocumentTypeImpl.hpp"
  @@ -73,7 +73,8 @@
   {
       name = dtName.clone();
       entities = new NamedNodeMapImpl(this);
  -    notations= new NamedNodeMapImpl(this);
  +    notations = new NamedNodeMapImpl(this);
  +	elements = new NamedNodeMapImpl(this);
       
   };
   
  @@ -93,7 +94,7 @@
   
       entities = new NamedNodeMapImpl(this);
       notations= new NamedNodeMapImpl(this);
  -    
  +	elements = new NamedNodeMapImpl(this);    
   };
   
   
  @@ -105,6 +106,7 @@
           cloneChildren(other);
       entities = other.entities->cloneMap(this);
       notations= other.notations->cloneMap(this);
  +	elements = other.elements->cloneMap(this);
       
       //DOM Level 2
       publicId		= other.publicId.clone();
  @@ -127,6 +129,11 @@
           notations->removeAll();
           NamedNodeMapImpl::removeRef(notations);
       }
  +	if (elements != null)
  +	{
  +		elements->removeAll();
  +		NamedNodeMapImpl::removeRef(elements);
  +	}
   };
   
   
  @@ -162,6 +169,10 @@
       return entities;
   };
   
  +NamedNodeMapImpl *DocumentTypeImpl::getElements()
  +{
  +    return elements;
  +};
   
   DOMString DocumentTypeImpl::getName()
   {
  
  
  
  1.15      +3 -1      xml-xerces/c/src/dom/DocumentTypeImpl.hpp
  
  Index: DocumentTypeImpl.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/dom/DocumentTypeImpl.hpp,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- DocumentTypeImpl.hpp	2000/04/27 02:52:43	1.14
  +++ DocumentTypeImpl.hpp	2000/07/05 23:16:10	1.15
  @@ -58,7 +58,7 @@
    */
   
   /*
  - * $Id: DocumentTypeImpl.hpp,v 1.14 2000/04/27 02:52:43 lehors Exp $
  + * $Id: DocumentTypeImpl.hpp,v 1.15 2000/07/05 23:16:10 jpolast Exp $
    */
   
   //
  @@ -82,6 +82,7 @@
       DOMString			name;
       NamedNodeMapImpl	*entities;
       NamedNodeMapImpl	*notations;
  +	NamedNodeMapImpl	*elements;
   	DOMString			publicId;
       DOMString			systemId;
   	DOMString			internalSubset;
  @@ -111,6 +112,7 @@
       virtual NamedNodeMapImpl * getEntities();
       virtual DOMString          getName();
       virtual NamedNodeMapImpl * getNotations();
  +	virtual NamedNodeMapImpl * getElements();
       virtual void               setNodeValue(const DOMString &arg); 
       virtual void               setReadOnly(bool readOnly, bool deep);
      
  
  
  
  1.25      +49 -17    xml-xerces/c/src/dom/ElementImpl.cpp
  
  Index: ElementImpl.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/dom/ElementImpl.cpp,v
  retrieving revision 1.24
  retrieving revision 1.25
  diff -u -r1.24 -r1.25
  --- ElementImpl.cpp	2000/06/22 00:48:44	1.24
  +++ ElementImpl.cpp	2000/07/05 23:16:10	1.25
  @@ -55,9 +55,9 @@
    */
   
   /*
  - * $Id: ElementImpl.cpp,v 1.24 2000/06/22 00:48:44 jpolast Exp $
  + * $Id: ElementImpl.cpp,v 1.25 2000/07/05 23:16:10 jpolast Exp $
    */
  -
  + 
   #include "DeepNodeListImpl.hpp"
   #include "DocumentImpl.hpp"
   #include "DocumentTypeImpl.hpp"
  @@ -74,6 +74,7 @@
   {
       name = eName.clone();
       attributes = null;
  +	setupDefaultAttributes();
   };
   
   
  @@ -82,10 +83,11 @@
   {
       name = other.name.clone();
   	attributes = null;
  +	setupDefaultAttributes();
       if (deep)
           cloneChildren(other);
   	if (other.attributes != null)
  -		attributes = other.attributes->cloneMap(this);
  +		attributes = other.attributes->cloneAttrMap(this);
   };
   
   
  @@ -141,7 +143,7 @@
   
   AttrImpl *ElementImpl::getAttributeNode(const DOMString &nam)
   {
  -    return (attributes == null) ? null : (AttrImpl *)(attributes->getNamedItem(nam));
  +    return (attributes == 0) ? null : (AttrImpl *)(attributes->getNamedItem(nam));
   };
   
   
  @@ -204,12 +206,12 @@
   	    // If it is in fact the right object, remove it.
       
   	    if (found == oldAttr)
  -	    {
   	        attributes->removeNamedItem(oldAttr->getName());
  -	        return found;
  -	    }
   	    else
   	        throw DOM_DOMException(DOM_DOMException::NOT_FOUND_ERR, null);
  +
  +        return found;	
  +		
   	}
   	return null;	// just to keep the compiler happy
   };
  @@ -225,8 +227,8 @@
       AttrImpl* newAttr = (AttrImpl*)getAttributeNode(nam);
       if (!newAttr)
       {
  -		if (attributes == null)
  -			attributes = new NamedNodeMapImpl(this);
  +		if (attributes == 0)
  +			attributes = new AttrMapImpl(this, null);
           newAttr = (AttrImpl*)ownerDocument->createAttribute(nam);
           attributes->setNamedItem(newAttr);
       }
  @@ -247,8 +249,8 @@
       
       if (!(newAttr->isAttrImpl()))
           throw DOM_DOMException(DOM_DOMException::WRONG_DOCUMENT_ERR, null);
  -	if (attributes == null)
  -		attributes = new NamedNodeMapImpl(this);
  +	if (attributes == 0)
  +		attributes = new AttrMapImpl(this, null);
       AttrImpl *oldAttr =
         (AttrImpl *) attributes->getNamedItem(newAttr->getName());
       // This will throw INUSE if necessary
  @@ -302,8 +304,8 @@
         (AttrImpl *) ownerDocument->createAttributeNS(fNamespaceURI,
                                                       qualifiedName);
       newAttr->setNodeValue(fValue);
  -	if (attributes == null)
  -		attributes = new NamedNodeMapImpl(this);
  +	if (attributes == 0)
  +		attributes = new AttrMapImpl(this, null);
       AttrImpl *oldAttr = (AttrImpl *)attributes->setNamedItem(newAttr);
   
       if (oldAttr) {
  @@ -350,8 +352,8 @@
       
       if (newAttr -> getOwnerDocument() != this -> getOwnerDocument())
           throw DOM_DOMException(DOM_DOMException::WRONG_DOCUMENT_ERR, null);
  -	if (attributes == null)
  -		attributes = new NamedNodeMapImpl(this);
  +	if (attributes == 0)
  +		attributes = new AttrMapImpl(this, null);
       AttrImpl *oldAttr = (AttrImpl *) attributes->getNamedItemNS(newAttr->getNamespaceURI(), newAttr->getLocalName());
       
       // This will throw INUSE if necessary
  @@ -420,7 +422,7 @@
   NodeImpl *ElementImpl::NNM_setNamedItem(NodeImpl *nnm_arg)
   {
   	if (getAttributes() == null)
  -		attributes = new NamedNodeMapImpl(this);
  +		attributes = new AttrMapImpl(this);
   	return attributes->setNamedItem(nnm_arg);
   }
   
  @@ -443,7 +445,7 @@
   NodeImpl *ElementImpl::NNM_setNamedItemNS(NodeImpl *nnm_arg)
   {
   	if (getAttributes() == null)
  -		attributes = new NamedNodeMapImpl(this);
  +		attributes = new AttrMapImpl(this);
   	return getAttributes()->setNamedItemNS(nnm_arg);
   }
   
  @@ -460,4 +462,34 @@
   {
   	if (getAttributes() != null)
   		getAttributes()->setOwnerDocument(nnm_doc);
  +}
  +
  +
  +// util functions for default attributes
  +// returns the default attribute map for this node from the owner document
  +AttrMapImpl *ElementImpl::getDefaultAttributes()
  +{
  +	if ((ownerNode == null) || (getOwnerDocument() == null))
  +		return null;
  +
  +	DocumentImpl *tmpdoc = getOwnerDocument();
  +	if (tmpdoc->getDoctype() == null)
  +		return null;
  +	
  +	NodeImpl *eldef = tmpdoc->getDoctype()->getElements()->getNamedItem(getNodeName());
  +	return (eldef == null) ? null : (AttrMapImpl *)(eldef->getAttributes());
  +}
  +
  +// resets all attributes for this node to their default values
  +void ElementImpl::setupDefaultAttributes()
  +{
  +	if ((ownerNode == null) || (getOwnerDocument() == null) || (getOwnerDocument()->getDoctype() == null))
  +		return;
  +
  +	if (attributes != 0)
  +		delete attributes;
  +	
  +	AttrMapImpl* defAttrs = getDefaultAttributes();
  +	if (defAttrs) 
  +		attributes = new AttrMapImpl(this, defAttrs);
   }
  
  
  
  1.15      +6 -1      xml-xerces/c/src/dom/ElementImpl.hpp
  
  Index: ElementImpl.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/dom/ElementImpl.hpp,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- ElementImpl.hpp	2000/06/22 00:48:45	1.14
  +++ ElementImpl.hpp	2000/07/05 23:16:10	1.15
  @@ -58,7 +58,7 @@
    */
   
   /*
  - * $Id: ElementImpl.hpp,v 1.14 2000/06/22 00:48:45 jpolast Exp $
  + * $Id: ElementImpl.hpp,v 1.15 2000/07/05 23:16:10 jpolast Exp $
    */
   
   //
  @@ -73,6 +73,7 @@
   
   #include <util/XercesDefs.hpp>
   #include "AttrImpl.hpp"
  +#include "AttrMapImpl.hpp"
   #include "ChildAndParentNode.hpp"
   
   class DeepNodeListImpl;
  @@ -80,7 +81,7 @@
   class CDOM_EXPORT ElementImpl: public ChildAndParentNode {
   protected:
       DOMString name;
  -    NamedNodeMapImpl *attributes;
  +    AttrMapImpl *attributes;
       
   public:
       ElementImpl(DocumentImpl *ownerDoc, const DOMString &name);
  @@ -135,6 +136,10 @@
       virtual NodeImpl       *NNM_setNamedItemNS(NodeImpl *nnm_arg);
       virtual NodeImpl       *NNM_removeNamedItemNS(const DOMString &nnm_namespaceURI, const DOMString &nnm_localName);
       virtual void            NNM_setOwnerDocument(DocumentImpl *nnm_doc);
  +    
  +	// default attribute helper functions
  +	virtual AttrMapImpl *getDefaultAttributes();
  +	virtual void setupDefaultAttributes();
   
   
   };
  
  
  
  1.15      +3 -1      xml-xerces/c/src/dom/Makefile.in
  
  Index: Makefile.in
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/dom/Makefile.in,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- Makefile.in	2000/05/15 20:45:44	1.14
  +++ Makefile.in	2000/07/05 23:16:11	1.15
  @@ -54,7 +54,7 @@
   # <http://www.apache.org/>.
   #
   #
  -# $Id: Makefile.in,v 1.14 2000/05/15 20:45:44 aruna1 Exp $
  +# $Id: Makefile.in,v 1.15 2000/07/05 23:16:11 jpolast Exp $
   #
   
   PLATFORM = @platform@
  @@ -103,6 +103,7 @@
   
   DOM_CPP_PRIVHEADERS =  \
   	AttrImpl.hpp \
  +	AttrMapImpl.hpp \
   	AttrNSImpl.hpp \
   	CDATASectionImpl.hpp \
   	CharacterDataImpl.hpp \
  @@ -140,6 +141,7 @@
   
   DOM_CPP_OBJECTS = \
   	AttrImpl.$(TO) \
  +	AttrMapImpl.$(TO) \
   	AttrNSImpl.$(TO) \
   	CDATASectionImpl.$(TO) \
   	CharacterDataImpl.$(TO) \
  
  
  
  1.17      +22 -2     xml-xerces/c/src/dom/NamedNodeMapImpl.cpp
  
  Index: NamedNodeMapImpl.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/dom/NamedNodeMapImpl.cpp,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- NamedNodeMapImpl.cpp	2000/06/02 00:06:02	1.16
  +++ NamedNodeMapImpl.cpp	2000/07/05 23:16:11	1.17
  @@ -55,7 +55,7 @@
    */
   
   /*
  - * $Id: NamedNodeMapImpl.cpp,v 1.16 2000/06/02 00:06:02 andyh Exp $
  + * $Id: NamedNodeMapImpl.cpp,v 1.17 2000/07/05 23:16:11 jpolast Exp $
    */
   
   #include "NamedNodeMapImpl.hpp"
  @@ -264,7 +264,7 @@
   //
   NodeImpl * NamedNodeMapImpl::setNamedItem(NodeImpl * arg)
   {
  -    if(arg->getOwnerDocument()!= ownerNode->getOwnerDocument())
  +    if(arg->getOwnerDocument() != ownerNode->getOwnerDocument())
           throw DOM_DOMException(DOM_DOMException::WRONG_DOCUMENT_ERR,null);
       if (readOnly)
           throw DOM_DOMException(DOM_DOMException::NO_MODIFICATION_ALLOWED_ERR, null);
  @@ -414,3 +414,23 @@
       }
   }
   
  +
  +void NamedNodeMapImpl::cloneContent(NamedNodeMapImpl *srcmap) {
  +	if ((srcmap != null) && (srcmap->nodes != null))
  +	{
  +		if (nodes != null)
  +			delete nodes;
  +		nodes = new NodeVector(srcmap->nodes->size());
  +		for (unsigned int i = 0; i < srcmap->nodes->size(); i++)
  +		{
  +			NodeImpl *n = srcmap->nodes->elementAt(i);
  + 			NodeImpl *clone = n->cloneNode(true);
  +			clone->specified(n->specified());
  +			clone->ownerNode = ownerNode;
  +			clone->owned(true);
  +			nodes->addElement(clone);
  +//			n = null;
  +//			clone = null;
  +		}
  +	}
  +}
  
  
  
  1.13      +4 -2      xml-xerces/c/src/dom/NamedNodeMapImpl.hpp
  
  Index: NamedNodeMapImpl.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/dom/NamedNodeMapImpl.hpp,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- NamedNodeMapImpl.hpp	2000/04/27 02:52:44	1.12
  +++ NamedNodeMapImpl.hpp	2000/07/05 23:16:11	1.13
  @@ -58,7 +58,7 @@
    */
   
   /*
  - * $Id: NamedNodeMapImpl.hpp,v 1.12 2000/04/27 02:52:44 lehors Exp $
  + * $Id: NamedNodeMapImpl.hpp,v 1.13 2000/07/05 23:16:11 jpolast Exp $
    */
   
   //
  @@ -78,7 +78,7 @@
   class NodeImpl;
   
   class CDOM_EXPORT NamedNodeMapImpl {
  -private:
  +protected:
       NodeVector       *nodes;
       NodeImpl         *ownerNode;    // the node this map belongs to
       bool              readOnly;
  @@ -91,6 +91,8 @@
       friend class      DomMemDebug;
       friend class      ElementImpl;
      	friend class	  DocumentImpl;
  +
  +	virtual void	cloneContent(NamedNodeMapImpl *srcmap);
       
   public:
       NamedNodeMapImpl(NodeImpl *ownerNode);
  
  
  
  1.1                  xml-xerces/c/src/dom/AttrMapImpl.cpp
  
  Index: AttrMapImpl.cpp
  ===================================================================
  /*
   * The Apache Software License, Version 1.1
   * 
   * Copyright (c) 1999-2000 The Apache Software Foundation.  All rights
   * reserved.
   * 
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   * 
   * 1. Redistributions of source code must retain the above copyright
   *    notice, this list of conditions and the following disclaimer. 
   * 
   * 2. Redistributions in binary form must reproduce the above copyright
   *    notice, this list of conditions and the following disclaimer in
   *    the documentation and/or other materials provided with the
   *    distribution.
   * 
   * 3. The end-user documentation included with the redistribution,
   *    if any, must include the following acknowledgment:  
   *       "This product includes software developed by the
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowledgment may appear in the software itself,
   *    if and wherever such third-party acknowledgments normally appear.
   * 
   * 4. The names "Xerces" and "Apache Software Foundation" must
   *    not be used to endorse or promote products derived from this
   *    software without prior written permission. For written 
   *    permission, please contact apache\@apache.org.
   * 
   * 5. Products derived from this software may not be called "Apache",
   *    nor may "Apache" appear in their name, without prior written
   *    permission of the Apache Software Foundation.
   * 
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * ====================================================================
   * 
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation, and was
   * originally based on software copyright (c) 1999, International
   * Business Machines, Inc., http://www.ibm.com .  For more information
   * on the Apache Software Foundation, please see
   * <http://www.apache.org/>.
   */
  
  
  /*
   * $Id: AttrMapImpl.cpp,v 1.1 2000/07/05 23:16:10 jpolast Exp $
   */
  
  #include "AttrMapImpl.hpp"
  #include "NamedNodeMapImpl.hpp"
  #include "NodeImpl.hpp"
  #include "ElementImpl.hpp"
  
  AttrMapImpl::AttrMapImpl(NodeImpl *ownerNod)
  	: NamedNodeMapImpl(ownerNod)
  {
  	hasDefaults(false);
  }
  
  AttrMapImpl::AttrMapImpl(NodeImpl *ownerNod, NamedNodeMapImpl *defaults)
  	: NamedNodeMapImpl(ownerNod)
  {
  	hasDefaults(false);
  	if (defaults != null) 
  	{
  		if (defaults->getLength() > 0) 
  		{
  			hasDefaults(true);
  			cloneContent(defaults);
  		}
  	} 
  }
  
  AttrMapImpl::~AttrMapImpl()
  {
  }
  
  AttrMapImpl *AttrMapImpl::cloneAttrMap(NodeImpl *ownerNode)
  {
  	AttrMapImpl *newmap = new AttrMapImpl(ownerNode);
  	newmap->cloneContent(this);
  	newmap->attrDefaults = this->attrDefaults;
  	return newmap;
  }
  
  bool AttrMapImpl::hasDefaults()
  {
  	return attrDefaults;
  }
  
  void AttrMapImpl::hasDefaults(bool value)
  {
  	attrDefaults = value;
  }
  
  NodeImpl *AttrMapImpl::removeNamedItem(const DOMString &name)
  {
  	NodeImpl* removed = NamedNodeMapImpl::removeNamedItem(name);
  
  	// Replace it if it had a default value
  	// (DOM spec level 1 - Element Interface)
  	if (hasDefaults() && (removed != null))
  	{
  		AttrMapImpl* defAttrs = ((ElementImpl*)ownerNode)->getDefaultAttributes();
  		AttrImpl* attr = (AttrImpl*)(defAttrs->getNamedItem(name));
  		if (attr != null)
  		{
  			AttrImpl* newAttr = (AttrImpl*)attr->cloneNode(true);
  			setNamedItem(newAttr);
  		}
  	}
  
  	return removed;
  }
  
  NodeImpl *AttrMapImpl::removeNamedItemNS(const DOMString &namespaceURI, const DOMString &localName)
  {
  	NodeImpl* removed = NamedNodeMapImpl::removeNamedItemNS(namespaceURI, localName);
  
  	// Replace it if it had a default value
  	// (DOM spec level 2 - Element Interface)
  	if (hasDefaults() && (removed != null))
  	{
  		AttrMapImpl* defAttrs = ((ElementImpl*)ownerNode)->getDefaultAttributes();
  		AttrImpl* attr = (AttrImpl*)(defAttrs->getNamedItemNS(namespaceURI, localName));
  		if (attr != null)
  		{
  			AttrImpl* newAttr = (AttrImpl*)attr->cloneNode(true);
  			setNamedItem(newAttr);
  		}
  	}
  
  	return removed;
  }
  
  
  1.1                  xml-xerces/c/src/dom/AttrMapImpl.hpp
  
  Index: AttrMapImpl.hpp
  ===================================================================
  #ifndef AttrMapImpl_HEADER_GUARD_
  #define AttrMapImpl_HEADER_GUARD_
  
  /*
   * The Apache Software License, Version 1.1
   * 
   * Copyright (c) 1999-2000 The Apache Software Foundation.  All rights
   * reserved.
   * 
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   * 
   * 1. Redistributions of source code must retain the above copyright
   *    notice, this list of conditions and the following disclaimer. 
   * 
   * 2. Redistributions in binary form must reproduce the above copyright
   *    notice, this list of conditions and the following disclaimer in
   *    the documentation and/or other materials provided with the
   *    distribution.
   * 
   * 3. The end-user documentation included with the redistribution,
   *    if any, must include the following acknowledgment:  
   *       "This product includes software developed by the
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowledgment may appear in the software itself,
   *    if and wherever such third-party acknowledgments normally appear.
   * 
   * 4. The names "Xerces" and "Apache Software Foundation" must
   *    not be used to endorse or promote products derived from this
   *    software without prior written permission. For written 
   *    permission, please contact apache\@apache.org.
   * 
   * 5. Products derived from this software may not be called "Apache",
   *    nor may "Apache" appear in their name, without prior written
   *    permission of the Apache Software Foundation.
   * 
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * ====================================================================
   * 
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation, and was
   * originally based on software copyright (c) 1999, International
   * Business Machines, Inc., http://www.ibm.com .  For more information
   * on the Apache Software Foundation, please see
   * <http://www.apache.org/>.
   */
  
  //
  //  This file is part of the internal implementation of the C++ XML DOM.
  //  It should NOT be included or used directly by application programs.
  //
  //  Applications should include the file <dom/DOM.hpp> for the entire
  //  DOM API, or DOM_*.hpp for individual DOM classes, where the class
  //  name is substituded for the *.
  //
  
  /*
   * $Id: AttrMapImpl.hpp,v 1.1 2000/07/05 23:16:10 jpolast Exp $
   */
  
  #include <util/XercesDefs.hpp>
  #include "AttrImpl.hpp"
  #include "NodeImpl.hpp"
  #include "NamedNodeMapImpl.hpp"
  
  class NamedNodeMapImpl;
  
  class CDOM_EXPORT AttrMapImpl : public NamedNodeMapImpl  
  {
  private:
  	bool attrDefaults;
  
  public:
  	AttrMapImpl(NodeImpl *ownerNod);
  	AttrMapImpl(NodeImpl *ownerNod, NamedNodeMapImpl *defaults);
  	virtual ~AttrMapImpl();
  	virtual AttrMapImpl *cloneAttrMap(NodeImpl *ownerNode);
  	virtual bool hasDefaults();
  	virtual void hasDefaults(bool value);
  
      virtual NodeImpl *removeNamedItem(const DOMString &name);
      virtual NodeImpl *removeNamedItemNS(const DOMString &namespaceURI, const DOMString &localName);
  };
  
  #endif