Returns true if the descendant_iterators have the same parent and point to the same child markup object.
Remarks
Test two descendant_iterators for equality or inequality. This
operation is not a member function, so it allows the conversion of descendant_iterator to const_descendant_iterator for both the left and right
arguments.
Complexity
Constant
Example
#include "xhtml_doc.h"
#include "xport_brochure.h"
#include <iostream>
#include <algorithm>
struct comp_by_id
{
comp_by_id(const std::string& s) : id_str(s) {}
bool operator() (const Xport::markup& mkup) { return mkup.attribute(Xport::id) == id_str; }
std::string id_str;
};
int main(int argc, char* argv[])
{
using namespace Xport;
// create a root document
document doc(root_doc);
// populate the document
xport_brochure broch;
broch.create(doc);
std::cout << "Finding element with id = 'ss_tbl_footnote'\n\n";
markup::const_descendant_iterator it = std::find_if(doc.descendant_begin(), doc.descendant_end(), comp_by_id("ss_tbl_footnote"));
if (it != doc.descendant_end()) {
std::cout << "Found element.\n\n";
// create a formatter object
formatter fmtr(std::cout);
fmtr << *it;
std::cout << "\n\n";
}
}
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.