Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / XmlUtils / System / Xml / Xsl / XsltOld / CopyAction.cs / 1305376 / CopyAction.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //[....] //----------------------------------------------------------------------------- namespace System.Xml.Xsl.XsltOld { using Res = System.Xml.Utils.Res; using System; using System.Diagnostics; using System.Xml; using System.Xml.XPath; using MS.Internal.Xml.XPath; internal class CopyAction : ContainerAction { // Local execution states private const int CopyText = 4; private const int NamespaceCopy = 5; private const int ContentsCopy = 6; private const int ProcessChildren = 7; private const int ChildrenOnly = 8; private string useAttributeSets; private bool empty; internal override void Compile(Compiler compiler) { CompileAttributes(compiler); if (compiler.Recurse()) { CompileTemplate(compiler); compiler.ToParent(); } if (this.containedActions == null) this.empty = true; } internal override bool CompileAttribute(Compiler compiler) { string name = compiler.Input.LocalName; string value = compiler.Input.Value; if (Ref.Equal(name, compiler.Atoms.UseAttributeSets)) { this.useAttributeSets = value; AddAction(compiler.CreateUseAttributeSetsAction()); } else { return false; } return true; } internal override void Execute(Processor processor, ActionFrame frame) { Debug.Assert(processor != null && frame != null); while (processor.CanContinue) { switch (frame.State) { case Initialized: if (Processor.IsRoot(frame.Node)) { processor.PushActionFrame(frame); frame.State = ChildrenOnly; break; } if (processor.CopyBeginEvent(frame.Node, this.empty) == false) { // This event wasn't processed break; } frame.State = NamespaceCopy; continue; case NamespaceCopy: frame.State = ContentsCopy; if ( frame.Node.NodeType == XPathNodeType.Element ) { processor.PushActionFrame(CopyNamespacesAction.GetAction(), frame.NodeSet); break; } continue; case ContentsCopy: if (frame.Node.NodeType == XPathNodeType.Element && !this.empty) { //Debug.Assert(frame.Node.HasValue == false); processor.PushActionFrame(frame); frame.State = ProcessChildren; break; } else { if (processor.CopyTextEvent(frame.Node)) { frame.State = ProcessChildren; continue; } else { // This event wasn't processed break; } } case ProcessChildren: if (processor.CopyEndEvent(frame.Node)) { frame.Finished(); } break; case ChildrenOnly: frame.Finished(); break; default: Debug.Fail("Invalid CopyAction execution state"); break; } break; } } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- SortedList.cs
- ItemsControlAutomationPeer.cs
- TextParaLineResult.cs
- DataFormats.cs
- DurableTimerExtension.cs
- DefaultProxySection.cs
- EdmError.cs
- RawStylusInputCustomData.cs
- DataGridViewColumnEventArgs.cs
- SqlPersonalizationProvider.cs
- TextEndOfParagraph.cs
- ProgressBar.cs
- OleAutBinder.cs
- LinkButton.cs
- StreamSecurityUpgradeAcceptorBase.cs
- CompilerResults.cs
- EncryptedData.cs
- SQLMembershipProvider.cs
- ReferentialConstraint.cs
- RegexParser.cs
- PropertyItem.cs
- IBuiltInEvidence.cs
- NavigationPropertySingletonExpression.cs
- XmlArrayAttribute.cs
- SocketConnection.cs
- FormClosingEvent.cs
- JsonByteArrayDataContract.cs
- LinkedResource.cs
- ProxyManager.cs
- PointConverter.cs
- RegistryPermission.cs
- SymbolMethod.cs
- DbConnectionHelper.cs
- DataControlCommands.cs
- AssemblySettingAttributes.cs
- EdmToObjectNamespaceMap.cs
- KeyGesture.cs
- CatalogPart.cs
- OleDbParameterCollection.cs
- GroupQuery.cs
- ellipse.cs
- SmtpSpecifiedPickupDirectoryElement.cs
- Constraint.cs
- WindowsSysHeader.cs
- CrossSiteScriptingValidation.cs
- CommonRemoteMemoryBlock.cs
- Ops.cs
- SrgsDocument.cs
- PolyLineSegment.cs
- ResXDataNode.cs
- XamlPathDataSerializer.cs
- HideDisabledControlAdapter.cs
- AllMembershipCondition.cs
- ListBoxChrome.cs
- Container.cs
- WebPartActionVerb.cs
- SqlDataSourceEnumerator.cs
- SelectionListComponentEditor.cs
- ChangesetResponse.cs
- DbConnectionStringBuilder.cs
- TextAutomationPeer.cs
- ComboBox.cs
- UnsafeNativeMethods.cs
- TypeDefinition.cs
- WsdlEndpointConversionContext.cs
- PropertyValueChangedEvent.cs
- ContainsSearchOperator.cs
- ClientProxyGenerator.cs
- StateWorkerRequest.cs
- Journal.cs
- HelpFileFileNameEditor.cs
- Baml6ConstructorInfo.cs
- TitleStyle.cs
- RegexCode.cs
- ModelVisual3D.cs
- BrowserDefinition.cs
- ContentTextAutomationPeer.cs
- Helpers.cs
- XmlSchemaSimpleType.cs
- Registry.cs
- base64Transforms.cs
- CalendarDesigner.cs
- EncoderBestFitFallback.cs
- CacheChildrenQuery.cs
- Debug.cs
- CompModSwitches.cs
- HotSpotCollection.cs
- ITreeGenerator.cs
- GuidTagList.cs
- RecipientIdentity.cs
- nulltextnavigator.cs
- LabelDesigner.cs
- RuleInfoComparer.cs
- AudioBase.cs
- SHA1Managed.cs
- NestedContainer.cs
- StateBag.cs
- CrossAppDomainChannel.cs
- HitTestParameters3D.cs
- SoapAttributeOverrides.cs