2 * This file is part of the DOM implementation for KDE.
4 * Copyright (C) 2000 Peter Kelly (pmk@post.com)
5 * Copyright (C) 2006 Apple Computer, Inc.
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Library General Public License for more details.
17 * You should have received a copy of the GNU Library General Public License
18 * along with this library; see the file COPYING.LIB. If not, write to
19 * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
20 * Boston, MA 02111-1307, USA.
23 #include "EntityReference.h"
27 EntityReference::EntityReference(Document* doc)
32 EntityReference::EntityReference(Document* doc, StringImpl* entityName)
34 , m_entityName(entityName)
38 String EntityReference::nodeName() const
40 return m_entityName.get();
43 Node::NodeType EntityReference::nodeType() const
45 return ENTITY_REFERENCE_NODE;
48 PassRefPtr<Node> EntityReference::cloneNode(bool deep)
50 RefPtr<EntityReference> clone = new EntityReference(document(), m_entityName.get());
51 // ### make sure children are readonly
52 // ### since we are a reference, should we clone children anyway (even if not deep?)
54 cloneChildNodes(clone.get());
55 return clone.release();
59 bool EntityReference::childTypeAllowed(NodeType type)
63 case PROCESSING_INSTRUCTION_NODE:
66 case CDATA_SECTION_NODE:
67 case ENTITY_REFERENCE_NODE:
75 String EntityReference::toString() const
78 result += m_entityName.get();