BeginEvent() private method

private BeginEvent ( XPathNodeType nodeType, string prefix, string name, string nspace, bool empty ) : bool
nodeType XPathNodeType
prefix string
name string
nspace string
empty bool
return bool
        internal override void Execute(Processor processor, ActionFrame frame) {
            Debug.Assert(processor != null && frame != null);

            switch (frame.State) {
            case Initialized:
                if (processor.BeginEvent(XPathNodeType.Comment, string.Empty, string.Empty, string.Empty, false) == false) {
                    // Come back later
                    break;
                }

                processor.PushActionFrame(frame);
                frame.State = ProcessingChildren;
                break;                              // Allow children to run

            case ProcessingChildren:
                if (processor.EndEvent(XPathNodeType.Comment) == false) {
                    break;
                }

                frame.Finished();
                break;

            default:
                Debug.Fail("Invalid IfAction execution state");
    		    break;
            }
        }
        internal override void Execute(Processor processor, ActionFrame frame)
        {
            Debug.Assert(processor != null && frame != null);

            switch (frame.State)
            {
            case Initialized:
                if (processor.BeginEvent(XPathNodeType.Comment, string.Empty, string.Empty, string.Empty, false) == false)
                {
                    // Come back later
                    break;
                }

                processor.PushActionFrame(frame);
                frame.State = ProcessingChildren;
                break;                              // Allow children to run

            case ProcessingChildren:
                if (processor.EndEvent(XPathNodeType.Comment) == false)
                {
                    break;
                }

                frame.Finished();
                break;

            default:
                Debug.Fail("Invalid IfAction execution state");
                break;
            }
        }
 public override bool Output(Processor processor, ActionFrame frame) {
     bool res;
     res = processor.BeginEvent(XPathNodeType.Namespace, /*prefix:*/null, this.name, this.namespaceUri, /*empty:*/false);
     Debug.Assert(res); // Namespace node as any other attribute can't fail because it doesn't signal record change
     res = processor.EndEvent(XPathNodeType.Namespace);
     Debug.Assert(res);
     return true;
 }
示例#4
0
        internal override void Execute(Processor processor, ActionFrame frame)
        {
            Debug.Assert(processor != null && frame != null);

            switch (frame.State)
            {
            case Initialized:
                if (_qname != null)
                {
                    frame.CalulatedName = _qname;
                }
                else
                {
                    frame.CalulatedName = CreateElementQName(
                        _nameAvt == null ? _name : _nameAvt.Evaluate(processor, frame),
                        _nsAvt == null ? _nsUri : _nsAvt.Evaluate(processor, frame),
                        _manager
                        );
                }
                goto case NameDone;

            case NameDone:
            {
                PrefixQName qname = frame.CalulatedName;
                if (processor.BeginEvent(XPathNodeType.Element, qname.Prefix, qname.Name, qname.Namespace, _empty) == false)
                {
                    // Come back later
                    frame.State = NameDone;
                    break;
                }

                if (!_empty)
                {
                    processor.PushActionFrame(frame);
                    frame.State = ProcessingChildren;
                    break;                                      // Allow children to run
                }
                else
                {
                    goto case ProcessingChildren;
                }
            }

            case ProcessingChildren:
                if (processor.EndEvent(XPathNodeType.Element) == false)
                {
                    frame.State = ProcessingChildren;
                    break;
                }
                frame.Finished();
                break;

            default:
                Debug.Fail("Invalid ElementAction execution state");
                break;
            }
        }
示例#5
0
        internal override void Execute(Processor processor, ActionFrame frame)
        {
            Debug.Assert(processor != null && frame != null);

            switch (frame.State)
            {
            case Initialized:
                if (this.qname != null)
                {
                    frame.CalulatedName = this.qname;
                }
                else
                {
                    frame.CalulatedName = CreateAttributeQName(
                        this.nameAvt == null ? this.name  : this.nameAvt.Evaluate(processor, frame),
                        this.nsAvt == null ? this.nsUri : this.nsAvt.Evaluate(processor, frame),
                        this.manager
                        );
                    if (frame.CalulatedName == null)
                    {
                        // name == "xmlns" case. Ignore xsl:attribute
                        frame.Finished();
                        break;
                    }
                }
                goto case NameDone;

            case NameDone:
            {
                PrefixQName qname = frame.CalulatedName;
                if (processor.BeginEvent(XPathNodeType.Attribute, qname.Prefix, qname.Name, qname.Namespace, false) == false)
                {
                    // Come back later
                    frame.State = NameDone;
                    break;
                }

                processor.PushActionFrame(frame);
                frame.State = ProcessingChildren;
                break;                                  // Allow children to run
            }

            case ProcessingChildren:
                if (processor.EndEvent(XPathNodeType.Attribute) == false)
                {
                    frame.State = ProcessingChildren;
                    break;
                }
                frame.Finished();
                break;

            default:
                Debug.Fail("Invalid ElementAction execution state");
                break;
            }
        }
示例#6
0
        public override bool Output(Processor processor, ActionFrame frame)
        {
            bool res;

            res = processor.BeginEvent(XPathNodeType.Namespace, /*prefix:*/ null, _name, _namespaceUri, /*empty:*/ false);
            Debug.Assert(res); // Namespace node as any other attribute can't fail because it doesn't signal record change
            res = processor.EndEvent(XPathNodeType.Namespace);
            Debug.Assert(res);
            return(true);
        }
        internal override void Execute(Processor processor, ActionFrame frame)
        {
            Debug.Assert(processor != null && frame != null);

            switch (frame.State)
            {
            case Initialized:
                if (_nameAvt == null)
                {
                    frame.StoredOutput = _name;
                    if (_name == null)
                    {
                        // name was static but was bad;
                        frame.Finished();
                        break;
                    }
                }
                else
                {
                    frame.StoredOutput = _nameAvt.Evaluate(processor, frame);
                    if (!IsProcessingInstructionName(frame.StoredOutput))
                    {
                        frame.Finished();
                        break;
                    }
                }
                goto case NameReady;

            case NameReady:
                Debug.Assert(frame.StoredOutput != null);
                if (processor.BeginEvent(XPathNodeType.ProcessingInstruction, string.Empty, frame.StoredOutput, string.Empty, false) == false)
                {
                    // Come back later
                    frame.State = NameReady;
                    break;
                }
                processor.PushActionFrame(frame);
                frame.State = ProcessingChildren;
                break;                                  // Allow children to run

            case ProcessingChildren:
                if (processor.EndEvent(XPathNodeType.ProcessingInstruction) == false)
                {
                    frame.State = ProcessingChildren;
                    break;
                }
                frame.Finished();
                break;

            default:
                Debug.Fail("Invalid ElementAction execution state");
                frame.Finished();
                break;
            }
        }
        internal override void Execute(Processor processor, ActionFrame frame) {
            Debug.Assert(processor != null && frame != null);

            while (processor.CanContinue) {
                switch (frame.State) {
                case Initialized:
                    if (frame.Node.MoveToFirstNamespace(XPathNamespaceScope.ExcludeXml) == false) {
                        frame.Finished();
                        break;
                    }

                    frame.State   = BeginEvent;
                    goto case BeginEvent;

                case BeginEvent:
                    Debug.Assert(frame.State == BeginEvent);
                    Debug.Assert(frame.Node.NodeType == XPathNodeType.Namespace);

                    if (processor.BeginEvent(XPathNodeType.Namespace, null, frame.Node.LocalName, frame.Node.Value, false) == false) {
                        // This one wasn't output
                        break;
                    }
                    frame.State = EndEvent;
                    continue;

                case EndEvent:
                    Debug.Assert(frame.State == EndEvent);
                    Debug.Assert(frame.Node.NodeType == XPathNodeType.Namespace);

                    if (processor.EndEvent(XPathNodeType.Namespace) == false) {
                        // This one wasn't output
                        break;
                    }
                    frame.State = Advance;
                    continue;

                case Advance:
                    Debug.Assert(frame.State == Advance);
                    Debug.Assert(frame.Node.NodeType == XPathNodeType.Namespace);

                    if (frame.Node.MoveToNextNamespace(XPathNamespaceScope.ExcludeXml)) {
                        frame.State = BeginEvent;
                        continue;
                    }
                    else {
                        frame.Node.MoveToParent();
                        frame.Finished();
                        break;
                    }
                }
                break;
            }// while
        }
 private static bool SendBeginEvent(Processor processor, XPathNavigator node)
 {
     Debug.Assert(node.NodeType == XPathNodeType.Attribute);
     return(processor.BeginEvent(XPathNodeType.Attribute, node.Prefix, node.LocalName, node.NamespaceURI, false));
 }
示例#10
0
 public override bool Output(Processor processor, ActionFrame frame)
 {
     return(processor.BeginEvent(_nodeType, _prefix, _name, _namespaceUri, _empty, _htmlProps, false));
 }
示例#11
0
 public override bool Output(Processor processor, ActionFrame frame)
 {
     return processor.BeginEvent(_nodeType, _prefix, _name, _namespaceUri, _empty, _htmlProps, false);
 }
        internal override void Execute(Processor processor, ActionFrame frame) {
            Debug.Assert(processor != null && frame != null);

            switch (frame.State) {
            case Initialized:
                if(this.nameAvt == null) {
                    frame.StoredOutput = this.name;
                    if(this.name == null) {
                        // name was static but was bad;
                        frame.Finished();
                        break;
                    }
                }
                else {
                    frame.StoredOutput = this.nameAvt.Evaluate(processor, frame);
                    if (! IsProcessingInstructionName(frame.StoredOutput)) {
                        frame.Finished();
                        break;
                    }
                }
                goto case NameReady;

            case NameReady:
                Debug.Assert(frame.StoredOutput != null);
                if (processor.BeginEvent(XPathNodeType.ProcessingInstruction, string.Empty, frame.StoredOutput, string.Empty, false) == false) {
                    // Come back later
                    frame.State = NameReady;
                    break;
                }
                processor.PushActionFrame(frame);
                frame.State = ProcessingChildren;
                break;                              // Allow children to run

            case ProcessingChildren:
                if (processor.EndEvent(XPathNodeType.ProcessingInstruction) == false) {
                    frame.State = ProcessingChildren;
                    break;
                }
                frame.Finished();
                break;
            default:
                Debug.Fail("Invalid ElementAction execution state");
                frame.Finished();
                break;
            }
        }
示例#13
0
 public override bool Output(Processor processor, ActionFrame frame) {
     return processor.BeginEvent(this.nodeType, this.prefix, this.name, this.namespaceUri, this.empty, this.htmlProps, false);
 }
示例#14
0
        internal override void Execute(Processor processor, ActionFrame frame)
        {
            Debug.Assert(processor != null && frame != null);

            while (processor.CanContinue)
            {
                switch (frame.State)
                {
                case Initialized:
                    if (frame.Node.MoveToFirstNamespace(XPathNamespaceScope.ExcludeXml) == false)
                    {
                        frame.Finished();
                        break;
                    }

                    frame.State = BeginEvent;
                    goto case BeginEvent;

                case BeginEvent:
                    Debug.Assert(frame.State == BeginEvent);
                    Debug.Assert(frame.Node.NodeType == XPathNodeType.Namespace);

                    if (processor.BeginEvent(XPathNodeType.Namespace, null, frame.Node.LocalName, frame.Node.Value, false) == false)
                    {
                        // This one wasn't output
                        break;
                    }
                    frame.State = EndEvent;
                    continue;

                case EndEvent:
                    Debug.Assert(frame.State == EndEvent);
                    Debug.Assert(frame.Node.NodeType == XPathNodeType.Namespace);

                    if (processor.EndEvent(XPathNodeType.Namespace) == false)
                    {
                        // This one wasn't output
                        break;
                    }
                    frame.State = Advance;
                    continue;

                case Advance:
                    Debug.Assert(frame.State == Advance);
                    Debug.Assert(frame.Node.NodeType == XPathNodeType.Namespace);

                    if (frame.Node.MoveToNextNamespace(XPathNamespaceScope.ExcludeXml))
                    {
                        frame.State = BeginEvent;
                        continue;
                    }
                    else
                    {
                        frame.Node.MoveToParent();
                        frame.Finished();
                        break;
                    }
                }
                break;
            }// while
        }
 public override bool Output(Processor processor, ActionFrame frame)
 {
     return(processor.BeginEvent(this.nodeType, this.prefix, this.name, this.namespaceUri, this.empty, this.htmlProps, false));
 }
        internal override void Execute(Processor processor, ActionFrame frame) {
            Debug.Assert(processor != null && frame != null);

            switch (frame.State) {
            case Initialized:
                if(this.qname != null) {
                    frame.CalulatedName = this.qname;
                }
                else {
                    frame.CalulatedName = CreateAttributeQName(
                        this.nameAvt == null ? this.name  : this.nameAvt.Evaluate(processor, frame),
                        this.nsAvt   == null ? this.nsUri : this.nsAvt  .Evaluate(processor, frame),
                        this.manager
                    );
                    if(frame.CalulatedName == null) {
                        // name == "xmlns" case. Ignore xsl:attribute
                        frame.Finished();
                        break;
                    }
                }
                goto case NameDone;
            case NameDone :
                {
                    PrefixQName qname = frame.CalulatedName;
                    if (processor.BeginEvent(XPathNodeType.Attribute, qname.Prefix, qname.Name, qname.Namespace, false) == false) {
                        // Come back later
                        frame.State = NameDone;
                        break;
                    }

                    processor.PushActionFrame(frame);
                    frame.State = ProcessingChildren;
                    break;                              // Allow children to run
                }
            case ProcessingChildren:
                if (processor.EndEvent(XPathNodeType.Attribute) == false) {
                    frame.State = ProcessingChildren;
                    break;
                }
                frame.Finished();
                break;
            default:
                Debug.Fail("Invalid ElementAction execution state");
    		    break;
            }
        }
 private static bool SendBeginEvent(Processor processor, XPathNavigator node) {
     Debug.Assert(node.NodeType == XPathNodeType.Attribute);
     return processor.BeginEvent(XPathNodeType.Attribute, node.Prefix, node.LocalName, node.NamespaceURI, false);
 }
示例#18
0
        internal override void Execute(Processor processor, ActionFrame frame)
        {
            Debug.Assert(processor != null && frame != null);

            switch (frame.State)
            {
                case Initialized:
                    if (_qname != null)
                    {
                        frame.CalulatedName = _qname;
                    }
                    else
                    {
                        frame.CalulatedName = CreateElementQName(
                            _nameAvt == null ? _name : _nameAvt.Evaluate(processor, frame),
                            _nsAvt == null ? _nsUri : _nsAvt.Evaluate(processor, frame),
                            _manager
                        );
                    }
                    goto case NameDone;

                case NameDone:
                    {
                        PrefixQName qname = frame.CalulatedName;
                        if (processor.BeginEvent(XPathNodeType.Element, qname.Prefix, qname.Name, qname.Namespace, _empty) == false)
                        {
                            // Come back later
                            frame.State = NameDone;
                            break;
                        }

                        if (!_empty)
                        {
                            processor.PushActionFrame(frame);
                            frame.State = ProcessingChildren;
                            break;                              // Allow children to run
                        }
                        else
                        {
                            goto case ProcessingChildren;
                        }
                    }
                case ProcessingChildren:
                    if (processor.EndEvent(XPathNodeType.Element) == false)
                    {
                        frame.State = ProcessingChildren;
                        break;
                    }
                    frame.Finished();
                    break;
                default:
                    Debug.Fail("Invalid ElementAction execution state");
                    break;
            }
        }