public void EndElement(String tag)
{
if (tag.Equals("Bookmark")) {
if (attr.Count == 0)
return;
else
throw new Exception(MessageLocalization.GetComposedMessage("bookmark.end.tag.out.of.place"));
}
if (!tag.Equals("Title"))
throw new Exception(MessageLocalization.GetComposedMessage("invalid.end.tag.1", tag));
Dictionary<String, Object> attributes = attr.Pop();
String title = (String)attributes["Title"];
attributes["Title"] = title.Trim();
String named = GetVal(attributes, "Named");
if (named != null)
attributes["Named"] = UnEscapeBinaryString(named);
named = GetVal(attributes, "NamedN");
if (named != null)
attributes["NamedN"] = UnEscapeBinaryString(named);
if (attr.Count == 0)
topList.Add(attributes);
else {
Dictionary<String, Object> parent = attr.Peek();
IList<Dictionary<String, Object>> kids = null;
if (parent.ContainsKey("Kids"))
kids = (IList<Dictionary<String, Object>>)parent["Kids"];
if (kids == null) {
kids = new List<Dictionary<String, Object>>();
parent["Kids"] = kids;
}
kids.Add(attributes);
}
}