Esempio n. 1
0
        private void CreateElement()
        {
            var element = new XPathElement(lastElement);

            if (lastPredicate != null)
            {
                element.Predicates.Add(lastPredicate);
            }

            this.PartQueue.Enqueue(element);

            lastPredicate = null;
            lastElement   = null;
            skipPredicate = false;
        }
Esempio n. 2
0
        public string Predicate(string node, string condition, bool reverseStep)
        {
            if (!reverseStep)
            {
                node = '(' + node + ')';
            }

            condition = condition.RegexRemove(".*::");

            if (!skipPredicate)
            {
                lastPredicate = new XPathPredicate(operandQueue.Dequeue());
            }

            return(node + '[' + condition + ']');
        }
Esempio n. 3
0
        public string Operator(XPathOperator op, string left, string right)
        {
            Debug.Assert(op != XPathOperator.Union);

            if (op == XPathOperator.UnaryMinus)
            {
                return("-" + left);
            }

            if (left.StartsWith("attribute::"))
            {
                left = left.Remove(0, "attribute::".Length);
            }

            lastPredicate = new XPathPredicate(operandQueue.Dequeue(), op, operandQueue.Dequeue());
            skipPredicate = true;

            return(left + opStrings[(int)op] + right);
        }