public static void AssertQuery(Query query) { if (!(query is FunctionQuery)) { XPathNavigator navigator2; query = Clone(query); XPathNavigator l = null; int count = query.Clone().Count; for (int i = 0; (navigator2 = query.Advance()) != null; i++) { if (navigator2.GetType().ToString() == "Microsoft.VisualStudio.Modeling.StoreNavigator") { return; } if (navigator2.GetType().ToString() == "System.Xml.DataDocumentXPathNavigator") { return; } if ((l != null) && ((l.NodeType != XPathNodeType.Namespace) || (navigator2.NodeType != XPathNodeType.Namespace))) { CompareNodes(l, navigator2); } l = navigator2.Clone(); } } }
// ----------------- Helper methods ------------- public static Query Clone(Query input) { if (input != null) { return (Query)input.Clone(); } return null; }
public static void AssertQuery(Query query) { Debug.Assert(query != null, "AssertQuery(): query == null"); if (query is FunctionQuery) { return; // Temp Fix. Functions (as document()) return now unordered sequences } query = Clone(query); XPathNavigator last = null; XPathNavigator curr; int querySize = query.Clone().Count; int actualSize = 0; while ((curr = query.Advance()) != null) { if (curr.GetType().ToString() == "Microsoft.VisualStudio.Modeling.StoreNavigator") { return; } if (curr.GetType().ToString() == "System.Xml.DataDocumentXPathNavigator") { return; } Debug.Assert(curr == query.Current, "AssertQuery(): query.Advance() != query.Current"); if (last != null) { if (last.NodeType == XPathNodeType.Namespace && curr.NodeType == XPathNodeType.Namespace) { // NamespaceQuery reports namsespaces in mixed order. // Ignore this for now. // It seams that this doesn't breake other queries becasue NS can't have children } else { XmlNodeOrder cmp = CompareNodes(last, curr); Debug.Assert(cmp == XmlNodeOrder.Before, "AssertQuery(): Wrong node order"); } } last = curr.Clone(); actualSize++; } Debug.Assert(actualSize == querySize, "AssertQuery(): actualSize != querySize"); }
public override XPathExpression Clone() { return(new CompiledXpathExpr(Query.Clone(_query), _expr, _needContext)); }
private LogicalExpr(LogicalExpr other) : base(other) { this.op = other.op; this.opnd1 = Query.Clone(other.opnd1); this.opnd2 = Query.Clone(other.opnd2); }
public static void AssertQuery(Query query) { Debug.Assert(query != null, "AssertQuery(): query == null"); if (query is FunctionQuery) return; // Temp Fix. Functions (as document()) return now unordered sequences query = Clone(query); XPathNavigator last = null; XPathNavigator curr; int querySize = query.Clone().Count; int actualSize = 0; while ((curr = query.Advance()) != null) { if (curr.GetType().ToString() == "Microsoft.VisualStudio.Modeling.StoreNavigator") return; if (curr.GetType().ToString() == "System.Xml.DataDocumentXPathNavigator") return; Debug.Assert(curr == query.Current, "AssertQuery(): query.Advance() != query.Current"); if (last != null) { if (last.NodeType == XPathNodeType.Namespace && curr.NodeType == XPathNodeType.Namespace) { // NamespaceQuery reports namsespaces in mixed order. // Ignore this for now. // It seams that this doesn't breake other queries becasue NS can't have children } else { XmlNodeOrder cmp = CompareNodes(last, curr); Debug.Assert(cmp == XmlNodeOrder.Before, "AssertQuery(): Wrong node order"); } } last = curr.Clone(); actualSize++; } Debug.Assert(actualSize == querySize, "AssertQuery(): actualSize != querySize"); }
public DescendantQuery(DescendantQuery other) : base(other) { this.nodeIterator = Query.Clone(other.nodeIterator); }
protected CacheOutputQuery(CacheOutputQuery other) : base(other) { this.input = Query.Clone(other.input); this.outputBuffer = new List <XPathNavigator>(other.outputBuffer); base.count = other.count; }
private NumberFunctions(NumberFunctions other) : base(other) { this.arg = Query.Clone(other.arg); this.ftype = other.ftype; }
private FollowingQuery(FollowingQuery other) : base((BaseAxisQuery)other) { this.input = Query.Clone(other.input); this.iterator = Query.Clone(other.iterator); }
private FollSiblingQuery(FollSiblingQuery other) : base((BaseAxisQuery)other) { this.elementStk = other.elementStk.Clone(); this.parentStk = new List <XPathNavigator>(other.parentStk); this.nextInput = Query.Clone(other.nextInput); }
private PrecedingQuery(PrecedingQuery other) : base((BaseAxisQuery)other) { this.workIterator = Query.Clone(other.workIterator); this.ancestorStk = other.ancestorStk.Clone(); }
public override XPathExpression Clone() { return(new CompiledXpathExpr(Query.Clone(this.query), this.expr, this.needContext)); }
private MergeFilterQuery(MergeFilterQuery other) : base((CacheOutputQuery)other) { this.child = Query.Clone(other.child); }
private BooleanExpr(BooleanExpr other) : base(other) { this.opnd1 = Query.Clone(other.opnd1); this.opnd2 = Query.Clone(other.opnd2); this.isOr = other.isOr; }
private NumericExpr(NumericExpr other) : base(other) { this.op = other.op; this.opnd1 = Query.Clone(other.opnd1); this.opnd2 = Query.Clone(other.opnd2); }
protected ChildrenQuery(ChildrenQuery other) : base((BaseAxisQuery)other) { this.iterator = XPathEmptyIterator.Instance; this.iterator = Query.Clone(other.iterator); }
private FilterQuery(FilterQuery other) : base((BaseAxisQuery)other) { this.cond = Query.Clone(other.cond); this.noPosition = other.noPosition; }
private BooleanFunctions(BooleanFunctions other) : base(other) { this.arg = Query.Clone(other.arg); this.funcType = other.funcType; }