private bool StartElement()
{
QilNode nd;
ReaderAnnotation ann = new ReaderAnnotation();
string s;
// Special case certain element names
s = _r.LocalName;
switch (_r.LocalName)
{
case "LiteralString":
nd = _f.LiteralString(ReadText());
break;
case "LiteralInt32":
nd = _f.LiteralInt32(Int32.Parse(ReadText(), CultureInfo.InvariantCulture));
break;
case "LiteralInt64":
nd = _f.LiteralInt64(Int64.Parse(ReadText(), CultureInfo.InvariantCulture));
break;
case "LiteralDouble":
nd = _f.LiteralDouble(Double.Parse(ReadText(), CultureInfo.InvariantCulture));
break;
case "LiteralDecimal":
nd = _f.LiteralDecimal(Decimal.Parse(ReadText(), CultureInfo.InvariantCulture));
break;
case "LiteralType":
nd = _f.LiteralType(ParseType(ReadText()));
break;
case "LiteralQName":
nd = ParseName(_r.GetAttribute("name"));
Debug.Assert(nd != null, "LiteralQName element must have a name attribute");
Debug.Assert(_r.IsEmptyElement, "LiteralQName element must be empty");
break;
case "For":
case "Let":
case "Parameter":
case "Function":
case "RefTo":
ann.Id = _r.GetAttribute("id");
ann.Name = ParseName(_r.GetAttribute("name"));
goto default;
case "XsltInvokeEarlyBound":
ann.ClrNamespace = _r.GetAttribute("clrNamespace");
goto default;
case "ForwardDecls":
_inFwdDecls = true;
goto default;
default:
// Create sequence
nd = _f.Sequence();
break;
}
// Save xml type and source line information
ann.XmlType = ParseType(_r.GetAttribute("xmlType")); ;
nd.SourceLine = ParseLineInfo(_r.GetAttribute("lineInfo"));
nd.Annotation = ann;
if (nd is QilList)
{
// Push new parent list onto stack
_stk.Push((QilList)nd);
return true;
}
// Add node to its parent's list
_stk.Peek().Add(nd);
return false;
}