1 // Created on: 2001-06-26
2 // Created by: Alexander GRIGORIEV
3 // Copyright (c) 2001-2014 OPEN CASCADE SAS
5 // This file is part of Open CASCADE Technology software library.
7 // This library is free software; you can redistribute it and/or modify it under
8 // the terms of the GNU Lesser General Public License version 2.1 as published
9 // by the Free Software Foundation, with special exception defined in the file
10 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
11 // distribution for complete text of the license and disclaimer of any warranty.
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement.
16 #ifndef LDOM_Element_HeaderFile
17 #define LDOM_Element_HeaderFile
19 #include <LDOM_Attr.hxx>
20 #include <LDOM_NodeList.hxx>
23 class LDOM_BasicElement;
28 class LDOM_Element : public LDOM_Node
31 // ---------- PUBLIC METHODS ----------
36 LDOM_Element (const LDOM_Element& anOther) : LDOM_Node (anOther) {}
39 LDOM_Element& operator = (const LDOM_Element& anOther)
40 { return (LDOM_Element&) LDOM_Node::operator = (anOther); }
43 LDOM_Element& operator = (const LDOM_NullPtr * aNull)
44 { return (LDOM_Element&) LDOM_Node::operator = (aNull); }
47 LDOMString getTagName () const { return getNodeName(); }
49 Standard_EXPORT LDOMString
50 getAttribute (const LDOMString& aName) const;
52 Standard_EXPORT LDOM_Attr
53 getAttributeNode (const LDOMString& aName) const;
55 Standard_EXPORT LDOM_NodeList
56 getElementsByTagName (const LDOMString& aName) const;
58 Standard_EXPORT void setAttribute (const LDOMString& aName,
59 const LDOMString& aValue);
61 Standard_EXPORT void setAttributeNode(const LDOM_Attr& aNewAttr);
63 Standard_EXPORT void removeAttribute (const LDOMString& aName);
66 Standard_EXPORT LDOM_Element
67 GetChildByTagName (const LDOMString& aTagName) const;
69 Standard_EXPORT LDOM_Element
70 GetSiblingByTagName () const;
73 ReplaceElement (const LDOM_Element& anOther);
74 // The old element is destroyed by the new one
76 Standard_EXPORT LDOM_NodeList
77 GetAttributesList () const;
80 friend class LDOM_Document;
81 friend class LDOMParser;
82 // ---------- PROTECTED METHODS ----------
84 LDOM_Element (const LDOM_BasicElement& anElem,
85 const Handle(LDOM_MemManager)& aDoc);
88 // ---------- PRIVATE FIELDS ----------