#include <cxxtools/xml/startelement.h>
Inheritance diagram for StartElement:

Public Member Functions | |
| StartElement () | |
| Constructs a new StartElement object with no name and an empty attribute list. | |
| StartElement (const String &name) | |
| Constructs a new StartElement object with the given string as tag name. | |
| ~StartElement () | |
| Empty destructor. | |
| StartElement * | clone () const |
| Clones this StartElement object by creating a duplicate on the heap and returning it. | |
| void | clear () |
| String & | name () |
| Returns the tag name of the opening tag for which this StartElement object was created. | |
| const String & | name () const |
| Returns the tag name of the opening tag for which this StartElement object was created. | |
| void | setName (const String name) |
| Sets the tag name of the end start for which this StartElement object was created. | |
| void | addAttribute (const Attribute &attribute) |
| Add the given attribute to the attribute list of this start tag. | |
| const std::list< Attribute > & | attributes () const |
| Returns the attribute list of this StartElement which contains all attributes of the tag. | |
| const String & | attribute (const String attributeName) const |
| Returns the value of the attribute with the given name. | |
| bool | hasAttribute (const String attributeName) const |
| const NamespaceContext & | namespaceContext () const |
| Returns the namespace conText of this StartElement. | |
| void | setNamespaceContext (const NamespaceContext &conText) |
| Sets the namespace conText for this StartElement. | |
| const String & | namespaceUri (const String &prefix) const |
| Returns the namespace uri for the given tag prefix in this StartElments namespace conText. | |
| virtual bool | operator== (const Node &node) const |
| Compares this StartElement object with the given node. | |
Use name() to get the name of the tag which was closed.
When parsing $test$ a StartElement, a Character and finally an EndElement node is created. If an empty tag is parsed, like for example $$, a StartElement and an EndElement is created.
| StartElement | ( | const String & | name | ) |
| name | The name of the EndElement object. This is an optional parameter. Default is an empty string. |
| StartElement* clone | ( | ) | const [virtual] |
| String& name | ( | ) |
When parsing test a StartElement, a Character and finally an EndElement node is created. The StartElement has the name "a". If an empty tag is parsed, like for example , only a StartElement and an EndElement ("a") is created.
| const String& name | ( | ) | const |
When parsing test a StartElement, a Character and finally an EndElement node is created. The StartElement has the name "a". If an empty tag is parsed, like for example , only a StartElement and an EndElement ("a") is created.
| void setName | ( | const String | name | ) |
| name | The new name for this StartElement object. |
| void addAttribute | ( | const Attribute & | attribute | ) |
This StartElement object holds a list of attributes, which consist of the attribute name and the attribute value. The attributes can be read using attributes() or attribute().
| attribute | The attribute which is added to this object's attribute list. |
| const std::list<Attribute>& attributes | ( | ) | const |
This StartElement object holds a list of attributes, which consist of the attribute name and the attribute value. This method returns all attributes of the represented tag. The list can be iterated using a iterator. To access a specific attribute the method attribute() can be used.
This StartElement object holds a list of attributes, which consist of the attribute name and the attribute value. This methods returns the value of a single attribute. To access all attributes of this StartElement the method attributes() can be used.
If no attribute with the given name exists, an empty string is returned.
| attributeName | The value of the attribute with this name is returned. |
| bool hasAttribute | ( | const String | attributeName | ) | const |
| attributeName | It is checked if an attribute with this attribute name exists. |
| const NamespaceContext& namespaceContext | ( | ) | const |
| void setNamespaceContext | ( | const NamespaceContext & | conText | ) |
The namespace uri is determined using the method NamespaceContext::namespaceUri(). If no namespace uri exists for this prefix an empty string is returned.
| prefix | The prefix for which the namespace uri is returned. |
| virtual bool operator== | ( | const Node & | node | ) | const [virtual] |
This method returns $true$ if the given node also is a StartElement object and the content of both StartElement objects is the same. Otherwise it returns $false$.
| node | This Node object is compared to the current StartElement node object. |
Reimplemented from Node.