1 // Created on: 2001-06-26
2 // Created by: Alexander GRIGORIEV
3 // Copyright (c) 2001-2012 OPEN CASCADE SAS
5 // The content of this file is subject to the Open CASCADE Technology Public
6 // License Version 6.5 (the "License"). You may not use the content of this file
7 // except in compliance with the License. Please obtain a copy of the License
8 // at http://www.opencascade.org and read it completely before using this file.
10 // The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
11 // main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
13 // The Original Code and all software distributed under the License is
14 // distributed on an "AS IS" basis, without warranty of any kind, and the
15 // Initial Developer hereby disclaims all such warranties, including without
16 // limitation, any warranties of merchantability, fitness for a particular
17 // purpose or non-infringement. Please see the License for the specific terms
18 // and conditions governing the rights and limitations under the License.
22 #ifndef LDOM_Element_HeaderFile
23 #define LDOM_Element_HeaderFile
25 #include <LDOM_Attr.hxx>
26 #include <LDOM_NodeList.hxx>
29 class LDOM_BasicElement;
34 class LDOM_Element : public LDOM_Node
37 // ---------- PUBLIC METHODS ----------
42 LDOM_Element (const LDOM_Element& anOther) : LDOM_Node (anOther) {}
45 LDOM_Element& operator = (const LDOM_Element& anOther)
46 { return (LDOM_Element&) LDOM_Node::operator = (anOther); }
49 Standard_EXPORT LDOM_Element&
50 operator = (const LDOM_NullPtr * aNull)
51 { return (LDOM_Element&) LDOM_Node::operator = (aNull); }
54 LDOMString getTagName () const { return getNodeName(); }
56 Standard_EXPORT LDOMString
57 getAttribute (const LDOMString& aName) const;
59 Standard_EXPORT LDOM_Attr
60 getAttributeNode (const LDOMString& aName) const;
62 Standard_EXPORT LDOM_NodeList
63 getElementsByTagName (const LDOMString& aName) const;
65 Standard_EXPORT void setAttribute (const LDOMString& aName,
66 const LDOMString& aValue);
68 Standard_EXPORT void setAttributeNode(const LDOM_Attr& aNewAttr);
70 Standard_EXPORT void removeAttribute (const LDOMString& aName);
73 Standard_EXPORT LDOM_Element
74 GetChildByTagName (const LDOMString& aTagName) const;
76 Standard_EXPORT LDOM_Element
77 GetSiblingByTagName () const;
80 ReplaceElement (const LDOM_Element& anOther);
81 // The old element is destroyed by the new one
83 Standard_EXPORT LDOM_NodeList
84 GetAttributesList () const;
87 friend class LDOM_Document;
88 friend class LDOMParser;
89 // ---------- PROTECTED METHODS ----------
91 LDOM_Element (const LDOM_BasicElement& anElem,
92 const Handle(LDOM_MemManager)& aDoc);
95 // ---------- PRIVATE FIELDS ----------