private XmlQueryType ParseType(string s)
{
if (s != null && s.Length > 0)
{
Match m = s_typeInfoRegex.Match(s);
Debug.Assert(m.Success && m.Groups.Count == 4, "Malformed Type info");
XmlQueryCardinality qc = new XmlQueryCardinality(m.Groups[1].Value);
bool strict = bool.Parse(m.Groups[3].Value);
string[] codes = m.Groups[2].Value.Split('|');
XmlQueryType[] types = new XmlQueryType[codes.Length];
for (int i = 0; i < codes.Length; i++)
types[i] = XmlQueryTypeFactory.Type((XmlTypeCode)Enum.Parse(typeof(XmlTypeCode), codes[i]), strict);
return XmlQueryTypeFactory.Product(XmlQueryTypeFactory.Choice(types), qc);
}
return null;
}