From 2c57a439676481590179718091f7404eb2e03ad7 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sun, 27 Apr 2014 12:32:17 +0200 Subject: Initial source code import --- xml/parser.txx | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 xml/parser.txx (limited to 'xml/parser.txx') diff --git a/xml/parser.txx b/xml/parser.txx new file mode 100644 index 0000000..35ed8e5 --- /dev/null +++ b/xml/parser.txx @@ -0,0 +1,30 @@ +// file : xml/parser.txx +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// license : MIT; see accompanying LICENSE file + +#include + +namespace xml +{ + template + T parser:: + attribute (const qname_type& qn, const T& dv) const + { + if (const element_entry* e = get_element ()) + { + attribute_map_type::const_iterator i (e->attr_map_.find (qn)); + + if (i != e->attr_map_.end ()) + { + if (!i->second.handled) + { + i->second.handled = true; + e->attr_unhandled_--; + } + return value_traits::parse (i->second.value, *this); + } + } + + return dv; + } +} -- cgit v1.1