aboutsummaryrefslogtreecommitdiff
path: root/cutl/xml/parser.txx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2013-03-15 20:13:04 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2013-03-15 20:13:04 +0200
commit707387b10340c7b95db35c8b791e57a2d02ccbaf (patch)
tree6b2a84c2c2b5e4d49a22f02d8d2c9d3d37085d24 /cutl/xml/parser.txx
parent927b97baaaf69e318ff7a0ce76d096375ec09da2 (diff)
Make attribute map valid throughout at "element level"
Diffstat (limited to 'cutl/xml/parser.txx')
-rw-r--r--cutl/xml/parser.txx21
1 files changed, 12 insertions, 9 deletions
diff --git a/cutl/xml/parser.txx b/cutl/xml/parser.txx
index cf27f2c..e5286f8 100644
--- a/cutl/xml/parser.txx
+++ b/cutl/xml/parser.txx
@@ -12,19 +12,22 @@ namespace cutl
T parser::
attribute (const qname_type& qn, const T& dv) const
{
- attribute_map::const_iterator i (attr_map_.find (qn));
-
- if (i != attr_map_.end ())
+ if (const element_entry* e = get_element ())
{
- if (!i->second.handled)
+ attribute_map::const_iterator i (e->attr_map_.find (qn));
+
+ if (i != e->attr_map_.end ())
{
- i->second.handled = true;
- attr_unhandled_--;
+ if (!i->second.handled)
+ {
+ i->second.handled = true;
+ e->attr_unhandled_--;
+ }
+ return value_traits<T>::parse (i->second.value, *this);
}
- return value_traits<T>::parse (i->second.value, *this);
}
- else
- return dv;
+
+ return dv;
}
}
}