internal NodeSelectCriteria(QueryAxisType axis, NodeQName qname, QueryNodeType nodeType) { this.axis = QueryDataModel.GetAxis(axis); this.qname = qname; this.qnameType = qname.GetQNameType(); this.type = nodeType; }
internal NodeSelectCriteria(QueryAxisType axis, NodeQName qname, QueryNodeType nodeType) { this.axis = QueryDataModel.GetAxis(axis); this.qname = qname; this.qnameType = qname.GetQNameType(); this.type = nodeType; }
internal NodeQNameType GetQNameType() { NodeQNameType empty = NodeQNameType.Empty; if (this.IsNameDefined) { if (this.IsNameWildcard) { empty = (NodeQNameType)((byte)(empty | NodeQNameType.NameWildcard)); } else { empty = (NodeQNameType)((byte)(empty | NodeQNameType.Name)); } } if (!this.IsNamespaceDefined) { return(empty); } if (this.IsNamespaceWildcard) { return((NodeQNameType)((byte)(empty | NodeQNameType.NamespaceWildcard))); } return((NodeQNameType)((byte)(empty | NodeQNameType.Namespace))); }
/// <summary> /// Return this qname's type - whether the name is defined, whether the name is a wildcard etc /// </summary> internal NodeQNameType GetQNameType() { NodeQNameType type = NodeQNameType.Empty; if (this.IsNameDefined) { if (this.IsNameWildcard) { type |= NodeQNameType.NameWildcard; } else { type |= NodeQNameType.Name; } } if (this.IsNamespaceDefined) { if (this.IsNamespaceWildcard) { type |= NodeQNameType.NamespaceWildcard; } else { type |= NodeQNameType.Namespace; } } return(type); }
internal bool MatchQName(SeekableXPathNavigator node) { switch (((NodeQNameType)((byte)(this.qnameType & NodeQNameType.Standard)))) { case NodeQNameType.Name: if (node.NamespaceURI.Length != 0) { return(false); } return(this.qname.EqualsName(node.LocalName)); case NodeQNameType.Standard: { string localName = node.LocalName; if ((this.qname.name.Length != localName.Length) || !(this.qname.name == localName)) { return(false); } localName = node.NamespaceURI; if (this.qname.ns.Length != localName.Length) { return(false); } return(this.qname.ns == localName); } } if (this.qnameType == NodeQNameType.Empty) { return(true); } NodeQNameType type2 = (NodeQNameType)((byte)(this.qnameType & NodeQNameType.Wildcard)); if (type2 != NodeQNameType.NameWildcard) { return(type2 == NodeQNameType.Wildcard); } return(this.qname.EqualsNamespace(node.NamespaceURI)); }