Elm  2
ELM is a library providing generic data structures, OS-independent interface, plugins and XML.
Element.h
1 /*
2  * $Id$
3  * Copyright (c) 2006, IRIT UPS.
4  *
5  * elm/xom/Element.h -- XOM Element class interface.
6  */
7 #ifndef ELM_XOM_ELEMENT_H
8 #define ELM_XOM_ELEMENT_H
9 
10 #include <elm/util/Option.h>
11 #include <elm/xom/ParentNode.h>
12 
13 namespace elm { namespace xom {
14 
15 // Predeclaration
16 class Attribute;
17 class Elements;
18 class Nodes;
19 
20 // Document class
21 class Element: public ParentNode {
22 protected:
23  friend class NodeFactory;
24  Element(void *node);
25  virtual Element *shallowCopy(void);
26  static void *makeNS(String name, String uri);
27 public:
28  Element(String name);
29  Element(String name, String uri);
30  Element(const Element *element);
31 
32  virtual void addAttribute(Attribute *attribute);
33  virtual void addNamespaceDeclaration(String prefix, String uri);
34  virtual void appendChild(String text);
35  virtual void appendChild(Node *node);
36  virtual Node *copy(void);
37  virtual Attribute *getAttribute(int index);
38  virtual Attribute *getAttribute(String name);
39  virtual Attribute *getAttribute(String localName, String ns);
40  virtual int getAttributeCount(void);
42  virtual Option<String> getAttributeValue(String localName, String ns);
43  virtual Elements *getChildElements(void);
44  virtual Elements *getChildElements(String name);
45  virtual Elements *getChildElements(String localName, String ns);
46  virtual Element *getFirstChildElement(String name);
47  virtual Element *getFirstChildElement(String localName, String ns);
48  virtual String getLocalName(void);
49  virtual int getNamespaceDeclarationCount(void);
50  virtual String getNamespacePrefix(void);
51  virtual String getNamespacePrefix(int index);
52  virtual String getNamespaceURI(void);
53  virtual String getNamespaceURI(String prefix);
54  virtual String getQualifiedName(void);
55  virtual String getValue(void);
56  virtual void insertChild(String text, int position);
57  virtual void insertChild(Node *node, int position);
58  virtual Attribute *removeAttribute(Attribute *attribute);
59  virtual Nodes *removeChildren(void);
60  virtual void removeNamespaceDeclaration(String prefix);
61  virtual void setBaseURI(String uri);
62  virtual void setLocalName(String local_name);
63  virtual void setNamespacePrefix(String prefix);
64  virtual void setNamespaceURI(String uri);
65  virtual String toString(void);
66  virtual String toXML(void);
67 };
68 
69 } } // elm::xom
70 
71 #endif // ELM_XOM_ELEMENT_H
elm::xom::Element::removeNamespaceDeclaration
virtual void removeNamespaceDeclaration(String prefix)
Definition: xom_Element.cpp:552
elm::Option
Definition: Option.h:35
elm::xom::Node::node
void * node
Definition: Node.h:60
elm::xom::Element::makeNS
static void * makeNS(String name, String uri)
Definition: xom_Element.cpp:44
elm::xom::NodeFactory
Definition: NodeFactory.h:27
elm::xom::Element::setNamespacePrefix
virtual void setNamespacePrefix(String prefix)
Definition: xom_Element.cpp:564
elm::xom::Nodes
Definition: Nodes.h:32
elm::xom::Element::addNamespaceDeclaration
virtual void addNamespaceDeclaration(String prefix, String uri)
Definition: xom_Element.cpp:163
elm::xom::Element::toXML
virtual String toXML(void)
Definition: xom_Element.cpp:577
elm::xom::Element::shallowCopy
virtual Element * shallowCopy(void)
Definition: xom_Element.cpp:119
elm::xom::String
Definition: String.h:35
elm::xom::Element::removeAttribute
virtual Attribute * removeAttribute(Attribute *attribute)
Definition: xom_Element.cpp:541
elm::xom::Element::setBaseURI
virtual void setBaseURI(String uri)
Definition: xom_Element.cpp:556
elm::xom::Element::getNamespaceDeclarationCount
virtual int getNamespaceDeclarationCount(void)
Definition: xom_Element.cpp:402
elm::xom::Element::getAttributeValue
virtual Option< String > getAttributeValue(String name)
Definition: xom_Element.cpp:265
elm::xom::Element::insertChild
virtual void insertChild(String text, int position)
Definition: xom_Element.cpp:517
elm::xom::Element::getValue
virtual String getValue(void)
Definition: xom_Element.cpp:506
elm::xom::Element::getFirstChildElement
virtual Element * getFirstChildElement(String name)
Definition: xom_Element.cpp:350
elm
Definition: adapter.h:26
elm::xom::Element::getChildElements
virtual Elements * getChildElements(void)
Definition: xom_Element.cpp:295
elm::xom::Elements
Definition: Elements.h:19
elm::xom::Element::setNamespaceURI
virtual void setNamespaceURI(String uri)
Definition: xom_Element.cpp:568
elm::xom::Element::removeChildren
virtual Nodes * removeChildren(void)
Definition: xom_Element.cpp:547
elm::xom::Element::getNamespacePrefix
virtual String getNamespacePrefix(void)
Definition: xom_Element.cpp:415
elm::xom::Element::getAttribute
virtual Attribute * getAttribute(int index)
Definition: xom_Element.cpp:203
elm::xom::ParentNode
Definition: ParentNode.h:15
elm::xom::Element::setLocalName
virtual void setLocalName(String local_name)
Definition: xom_Element.cpp:560
elm::xom::Element::addAttribute
virtual void addAttribute(Attribute *attribute)
Definition: xom_Element.cpp:135
elm::xom::Element::getAttributeCount
virtual int getAttributeCount(void)
Definition: xom_Element.cpp:251
elm::xom::Element::Element
Element(void *node)
Definition: xom_Element.cpp:67
elm::xom::Element::getNamespaceURI
virtual String getNamespaceURI(void)
Definition: xom_Element.cpp:461
elm::xom::Element::getLocalName
virtual String getLocalName(void)
Definition: xom_Element.cpp:382
elm::xom::Element
Definition: Element.h:21
elm::xom::Element::appendChild
virtual void appendChild(String text)
Definition: xom_Element.cpp:174
elm::xom::Element::getQualifiedName
virtual String getQualifiedName(void)
Definition: xom_Element.cpp:489
elm::xom::Attribute
Definition: Attribute.h:30
elm::xom::Element::toString
virtual String toString(void)
Definition: xom_Element.cpp:572
elm::xom::Element::copy
virtual Node * copy(void)
Definition: xom_Element.cpp:181
elm::xom::Node
Definition: Node.h:40