private void LoadSelectFilter(XmlNodeKindFlags xmlTypes, QilName ndName) {
if (ndName != null) {
// Push NameFilter
Debug.Assert(xmlTypes == XmlNodeKindFlags.Element);
this.helper.CallGetNameFilter(this.helper.StaticData.DeclareNameFilter(ndName.LocalName, ndName.NamespaceUri));
}
else {
// Either type cannot be a union, or else it must be >= union of all Content types
bool isXmlTypeUnion = IsNodeTypeUnion(xmlTypes);
Debug.Assert(!isXmlTypeUnion || (xmlTypes & XmlNodeKindFlags.Content) == XmlNodeKindFlags.Content);
if (isXmlTypeUnion) {
if ((xmlTypes & XmlNodeKindFlags.Attribute) != 0) {
// Union includes attributes, so allow all node kinds
this.helper.CallGetTypeFilter(XPathNodeType.All);
}
else {
// Filter attributes
this.helper.CallGetTypeFilter(XPathNodeType.Attribute);
}
}
else {
// Filter nodes of all but one type
this.helper.CallGetTypeFilter(QilXmlToXPathNodeType(xmlTypes));
}
}
}