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>
22 class LDOM_BasicElement;
27 class LDOM_Element : public LDOM_Node
30 // ---------- PUBLIC METHODS ----------
35 LDOM_Element (const LDOM_Element& anOther) : LDOM_Node (anOther) {}
38 LDOM_Element& operator = (const LDOM_Element& anOther)
39 { return (LDOM_Element&) LDOM_Node::operator = (anOther); }
42 LDOM_Element& operator = (const LDOM_NullPtr * aNull)
43 { return (LDOM_Element&) LDOM_Node::operator = (aNull); }
46 LDOMString getTagName () const { return getNodeName(); }
48 Standard_EXPORT LDOMString
49 getAttribute (const LDOMString& aName) const;
51 Standard_EXPORT LDOM_Attr
52 getAttributeNode (const LDOMString& aName) const;
54 Standard_EXPORT LDOM_NodeList
55 getElementsByTagName (const LDOMString& aName) const;
57 Standard_EXPORT void setAttribute (const LDOMString& aName,
58 const LDOMString& aValue);
60 Standard_EXPORT void setAttributeNode(const LDOM_Attr& aNewAttr);
62 Standard_EXPORT void removeAttribute (const LDOMString& aName);
65 Standard_EXPORT LDOM_Element
66 GetChildByTagName (const LDOMString& aTagName) const;
68 Standard_EXPORT LDOM_Element
69 GetSiblingByTagName () const;
72 ReplaceElement (const LDOM_Element& anOther);
73 // The old element is destroyed by the new one
75 Standard_EXPORT LDOM_NodeList
76 GetAttributesList () const;
79 friend class LDOM_Document;
80 friend class LDOMParser;
81 // ---------- PROTECTED METHODS ----------
83 LDOM_Element (const LDOM_BasicElement& anElem,
84 const Handle(LDOM_MemManager)& aDoc);
87 // ---------- PRIVATE FIELDS ----------