Commit aaa44531 authored by Stef Walter's avatar Stef Walter Committed by Murray Cumming

Added get_attribute_value(), to get a simple text value for an attribute,

2007-07-30  Stef Walter  <stef@memberwebs.com>

* libxml++/nodes/element.cc:
* libxml++/nodes/element.h: Added get_attribute_value(), 
to get a simple text value for an attribute, as a 
convenience.

2007-07-30  Murray Cumming  <murrayc@murrayc.com>

* docs/reference/Doxyfile.in: Added newin2p18, 
newin2p20, and newin2p22 tags.

This is the trunk branch for libxml++ 2.19/2.20.
See also the gnome-2-18 branch.

svn path=/trunk/; revision=157
parent afd84419
2007-07-30 Stef Walter <stef@memberwebs.com>
* libxml++/nodes/element.cc:
* libxml++/nodes/element.h: Added get_attribute_value(),
to get a simple text value for an attribute, as a
convenience.
2007-07-30 Murray Cumming <murrayc@murrayc.com>
* docs/reference/Doxyfile.in: Added newin2p18,
newin2p20, and newin2p22 tags.
This is the trunk branch for libxml++ 2.19/2.20.
See also the gnome-2-18 branch.
2.18.2:
2007-07-25 Christophe de Vienne <cdevienne@gmail.com>
......
......@@ -24,7 +24,9 @@ DETAILS_AT_TOP = NO
INHERIT_DOCS = YES
DISTRIBUTE_GROUP_DOC = NO
TAB_SIZE = 8
ALIASES =
ALIASES = "newin2p18=\xrefitem newin2p18s \"Since libxml++ 2.18\" \"New API in libxml++ 2.18\" \n" \
"newin2p20=\xrefitem newin2p20s \"Since libxml++ 2.20\" \"New API in libxml++ 2.20\" \n" \
"newin2p22=\xrefitem newin2p22s \"Since libxml++ 2.22\" \"New API in libxml++ 2.22\" \n"
OPTIMIZE_OUTPUT_FOR_C = NO
OPTIMIZE_OUTPUT_JAVA = NO
SUBGROUPING = YES
......
......@@ -61,6 +61,13 @@ Attribute* Element::get_attribute(const Glib::ustring& name,
return 0;
}
Glib::ustring Element::get_attribute_value(const Glib::ustring& name,
const Glib::ustring& ns_prefix) const
{
Attribute* attr = get_attribute(name, ns_prefix);
return attr ? attr->get_value() : Glib::ustring();
}
Attribute* Element::set_attribute(const Glib::ustring& name, const Glib::ustring& value,
const Glib::ustring& ns_prefix)
{
......
......@@ -46,6 +46,17 @@ public:
Attribute* get_attribute(const Glib::ustring& name,
const Glib::ustring& ns_prefix = Glib::ustring()) const;
/** Get the value of the attribute with this name, and optionally with this namespace.
* For finer control, you might use get_attribute() and use the methods of the Attribute class.
* @param name The name of the attribute whose value will be retrieved.
* @param ns_prefix Namespace prefix.
* @return The text value of the attribute, or an empty string if no such attribute was found.
*
* @newin2p20
*/
Glib::ustring get_attribute_value(const Glib::ustring& name,
const Glib::ustring& ns_prefix = Glib::ustring()) const;
/** Set the value of the attribute with this name, and optionally with this namespace.
* A matching attribute will be added if no matching attribute already exists.
* For finer control, you might want to use get_attribute() and use the methods of the Attribute class.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment