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

Attribute Class Reference

A class representing a single attribute of a tag from an XML document. More...

#include <cxxtools/xml/startelement.h>

List of all members.

Public Member Functions

 Attribute ()
 Constructs a new Attribute object with an empty name and value.
 Attribute (const String &name, const String &value)
 Constructs a new Attribute using the given name and value.
virtual ~Attribute ()
 Empty destructor.
const Stringname () const
 Returns the name of this attribute.
Stringname ()
void setName (const String name)
 Sets the name of this attribute.
const Stringvalue () const
 Returns the value of this attribute.
Stringvalue ()
void setValue (const String value)
 Sets the value of this attribute.
void clear ()


Detailed Description

An XML attribute consists of the attribute's name and the attribute's value. The name can be retrieved using the method name(). The value can be retrieved using the method value().

The attributes of a tag are retrieved from the document when the opening tag is parsed. The attributes are stored in a StartElement object from where they can be retrieved.


Constructor & Destructor Documentation

Attribute ( const String name,
const String value 
)

Parameters:
name The name of the XML attribute.
value The value of the XML attribute.


Member Function Documentation

const String& name (  )  const

Returns:
The attribute's name.

void setName ( const String  name  ) 

Parameters:
name The new name of this attribute.

const String& value (  )  const

Returns:
The attribute's value.

void setValue ( const String  value  ) 

Parameters:
value The new value of this attribute.

Copyright © 2008 The Tntnet Development Team
Tntnet 1.6