System.Xml.Xsl.IlGen.XmlILVisitor.LoadSelectFilter C# (CSharp) Method

LoadSelectFilter() private method

Load an XmlNavigatorFilter that matches only the specified name and types onto the stack.
private LoadSelectFilter ( XmlNodeKindFlags xmlTypes, QilName ndName ) : void
xmlTypes XmlNodeKindFlags
ndName System.Xml.Xsl.Qil.QilName
return void
        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));
                }
            }
        }
XmlILVisitor