bool VariableBindings::getVariableValue(const std::string &name, XmlResults &value) const { Values::const_iterator i = values_.find(name); if (i != values_.end()) { value = i->second; value.reset(); } else { value = XmlResults(); } return !value.isNull(); }
bool XmlQueryContext::getVariableValue(const string &name, XmlValue &value) const { CHECK_POINTER; XmlResults results; bool success = queryContext_->getVariableValue(name, results); if(!success) return false; if(results.size() > 1) { throw XmlException(XmlException::INVALID_VALUE, "Variable has more than one value assigned to it"); } results.reset(); results.next(value); return true; }