Beispiel #1
0
        //
        ///
        ///
        private IQuery ProcessAxis(Axis root, IQuery qyInput)
        {
            IQuery result = null;

            switch (root.TypeOfAxis)
            {
            case Axis.AxisType.Attribute:
                result = new AttributeQuery(qyInput, root.Name, root.Prefix, root.Type);
                break;

            case Axis.AxisType.Self:
                result = new XPathSelfQuery(qyInput, root.Name, root.Prefix, root.Type);
                break;

            case Axis.AxisType.Child:
                result = new ChildQuery(qyInput, root.Name, root.Prefix, root.Type);
                break;

            case Axis.AxisType.Descendant:
            case Axis.AxisType.DescendantOrSelf:
                result = new DescendantQuery(qyInput, root.Name, root.Prefix, root.Type);
                break;

            default:
                throw new XPathReaderException("xpath is not supported!");
            }

            return(result);
        }
        //
        ///
        ///
        private IQuery ProcessAxis(Axis root , IQuery qyInput) {
            IQuery result = null;

            switch (root.TypeOfAxis) {

                case Axis.AxisType.Attribute:
                    result = new AttributeQuery(qyInput, root.Name, root.Prefix, root.Type);
                    break;

                case Axis.AxisType.Self:
                    result = new XPathSelfQuery(qyInput,  root.Name, root.Prefix, root.Type);
                    break;

                case Axis.AxisType.Child:
                    result = new ChildQuery( qyInput, root.Name, root.Prefix, root.Type);
                    break;

                case Axis.AxisType.Descendant:
                case Axis.AxisType.DescendantOrSelf:
                    result = new DescendantQuery(qyInput, root.Name, root.Prefix, root.Type);
                    break;

                default:
                    throw new XPathReaderException("xpath is not supported!"); 
            }

            return result;
        }