summaryrefslogtreecommitdiff
path: root/src/xpath.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2007-05-19 07:34:52 +0000
committerJohn Wiegley <johnw@newartisans.com>2008-04-13 03:39:05 -0400
commit3e0f510b296c0b72353f146912bb0225af0a5647 (patch)
tree8ff4098ea790bbaf2b26a13d1b76487fe80b6041 /src/xpath.cc
parent5a72d17d026aa6a1bb0cd32f413963ef9f24ab64 (diff)
downloadledger-3e0f510b296c0b72353f146912bb0225af0a5647.tar.gz
ledger-3e0f510b296c0b72353f146912bb0225af0a5647.tar.bz2
ledger-3e0f510b296c0b72353f146912bb0225af0a5647.zip
More work on the compilation of nodes.
Diffstat (limited to 'src/xpath.cc')
-rw-r--r--src/xpath.cc9
1 files changed, 2 insertions, 7 deletions
diff --git a/src/xpath.cc b/src/xpath.cc
index 98988c64..f779ebc6 100644
--- a/src/xpath.cc
+++ b/src/xpath.cc
@@ -1208,16 +1208,11 @@ value_t xpath_t::op_t::calc(scope_t& scope)
case ATTR_ID:
case ATTR_NAME:
- if (optional<value_t> value =
+ if (optional<value_t&> value =
kind == ATTR_ID ? current_xml_node(scope).get_attr(as_name()) :
current_xml_node(scope).get_attr(as_string()))
return *value;
- else
- throw_(calc_error, "Attribute '"
- << (kind == ATTR_ID ?
- *current_xml_node(scope).document().lookup_name(as_long()) :
- as_string().c_str())
- << "' was not found");
+
break;
case O_NEQ: