Webmaster  |  Imprint 
C++ Server Pages
Main  |  License  |  Documentation  |  Download 

EndElement Class Reference

An end element (Node) which represents a closing tag of an XML document. More...

#include <cxxtools/xml/endelement.h>

Inheritance diagram for EndElement:

Node

List of all members.

Public Member Functions

 EndElement (const String &name=String())
 Constructs a new EndElement object with the given (optional) string as tag name.
 ~EndElement ()
 Empty destructor.
EndElementclone () const
 Clones this EndElement object by creating a duplicate on the heap and returning it.
void clear ()
Stringname ()
 Returns the tag name of the closing tag for which this EndElement object was created.
const Stringname () const
 Returns the tag name of the closing tag for which this EndElement object was created.
void setName (const String name)
 Sets the tag name of the end tag for which this EndElement object was created.
virtual bool operator== (const Node &node) const
 Compares this EndElement object with the given node.


Detailed Description

An end element is created when the parser reaches an end tag, for example $</a>$. An EndElement object only stores the name of the tag. To access the attributes of the tag the start tag has to be read. The body of the tag can be accessed by reading the previous Character node(s).

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.

See also:
StartElement

Node


Constructor & Destructor Documentation

EndElement ( const String name = String()  ) 

Parameters:
name The name of the EndElement object. This is an optional parameter. Default is an empty string.


Member Function Documentation

EndElement* clone (  )  const [virtual]

Returns:
A cloned version of this EndElement object.

Implements Node.

String& name (  ) 

When parsing test a StartElement, a Character and finally an EndElement node is created. The EndElement has the name "a". If an empty tag is parsed, like for example , a StartElement and an EndElement ("a") is created.

Returns:
The tag name of the closing tag for which this EndElement object was created.

const String& name (  )  const

When parsing test a StartElement, a Character and finally an EndElement node is created. The EndElement has the name "a". If an empty tag is parsed, like for example , a StartElement and an EndElement ("a") is created.

Returns:
The tag name of the closing tag for which this EndElement object was created.

void setName ( const String  name  ) 

Parameters:
name The new name for this EndElement object.

virtual bool operator== ( const Node node  )  const [virtual]

This method returns $true$ if the given node also is a EndElement object and the name of both EndElement objects is the same. Otherwise it returns $false$.

Parameters:
node This Node object is compared to the current EndElement node object.
Returns:
$true if this EndElement object is the same as the given node.

Reimplemented from Node.

Copyright © 2008 The Tntnet Development Team
Tntnet 1.6