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; }
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; } }
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; } }
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 SendEndEvent(Processor processor, XPathNavigator node) { Debug.Assert(node.NodeType == XPathNodeType.Attribute); return processor.EndEvent(XPathNodeType.Attribute); }
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 SendEndEvent(Processor processor, XPathNavigator node) { Debug.Assert(node.NodeType == XPathNodeType.Attribute); return(processor.EndEvent(XPathNodeType.Attribute)); }
public override bool Output(Processor processor, ActionFrame frame) { return processor.EndEvent(this.nodeType); }
public override bool Output(Processor processor, ActionFrame frame) { return(processor.EndEvent(_nodeType)); }
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; } }