Xport Interface: markup::attribute

For a derived element object, sets or retrieves an attribute value.

virtual std::string markup::attribute(1st Variety
  xhtml_attribute attrib
);
virtual bool markup::attribute(2nd Variety
  xhtml_attribute attrib,
  const std::string& value
);

Parameters

attrib

An xhtml_attribute enumerator. For a list of xhtml_attribute enumerators, see Xport Usage: Enumerations.

value

A string value which represents the value of the accompanied attribute.

Returns

In the first variety, returns the string value of the specified attribute if called on an element object and the attribute is present within the element, or an empty string otherwise. In the second variety, returns true if called on an element object and the attribute is set successfully, false otherwise.

Remarks

This operation is revelant only if it is called on a derived element object. If called on a pcdata, comment, or procinstr object, the first variety will always return an empty string, and the second variety will always return false.

When called on a derived element object, the operation will be executed appropriately. See element::attribute() for more details.

Complexity

Constant

Example

Work Time Studio

Datasoft Solutions is proud to present their landmark product, Work Time Studio. Utilizing the tree container library, Work Time Studio provides unparalleled features in personal time, project and task management software. If you're looking for a way to increase your productivity, visit Work Time Studio's product website, and start being more productive today.