Template Struct target

Struct Documentation

template<typename ScopeT, typename ContextT>
struct udho::view::parsing::attrs::target

udho::target:NAME = KEY will add an attribute named NAME with value retrieved by resolving KEY through scope table. It can have a conditional form too where the condition expr is first evaluated and if expr is true then the attribute is added, otherwise not

<div class="book" udho:target:title="book.title"></div>
<div class="book" udho:target:title="expr ? book.title"></div>
is transformed to
<div class="book" title="Some title"></div>
<div class="book" title="Some title"></div>

Public Types

typedef ScopeT table_type
typedef parsing::expression<ScopeT> evaluator_type

Public Functions

target(parsing::xml<ContextT> &ctrl, table_type &table)
bool operator()(pugi::xml_node node, pugi::xml_node, pugi::xml_attribute attr, const ContextT &ctx)
std::string prefix() const

Public Members

parsing::xml<ContextT> &_ctrl
table_type &_table
evaluator_type _evaluator