private bool IsOrderedSet() { for (int k = 0; k < _path.Length; k++) { XPath2ExprType exprType; if (_path[k].type == XPath2ExprType.Expr) { if (k == 0) { continue; } FilterExprNode filterExpr = _path[k].node as FilterExprNode; if (filterExpr == null) { return(false); } PathExprNode pathExpr = filterExpr[0] as PathExprNode; if (pathExpr == null) { return(false); } exprType = pathExpr._path[0].type; } else { exprType = _path[k].type; } switch (exprType) { case XPath2ExprType.Expr: case XPath2ExprType.Parent: case XPath2ExprType.Ancestor: case XPath2ExprType.AncestorOrSelf: case XPath2ExprType.Preceding: case XPath2ExprType.PrecedingSibling: return(false); case XPath2ExprType.Descendant: case XPath2ExprType.DescendantOrSelf: case XPath2ExprType.Following: case XPath2ExprType.ChildOverDescendants: if (k < _path.Length - 1) { for (int s = k + 1; s < _path.Length; s++) { if (_path[s].type != XPath2ExprType.Attribute && _path[s].type != XPath2ExprType.Namespace) { return(false); } } } break; } } return(true); }
public override void Bind() { if (Count > 0) { PathExprNode pathExpr = this[0] as PathExprNode; if (pathExpr != null && s_aggregates.Contains(_name) && _ns == XmlReservedNs.NsXQueryFunc) { pathExpr.Unordered = true; } } base.Bind(); }
public static PathStep Create(XPath2Context context, object node) { PathStep res = node as PathStep; if (res != null) { return(res); } PathExprNode pathExpr = node as PathExprNode; if (pathExpr != null) { return(pathExpr.FirstStep); } return(new PathStep(AbstractNode.Create(context, node))); }