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
- SplashScreen.cs
- MobileRedirect.cs
- PreviewControlDesigner.cs
- X509Chain.cs
- HttpHostedTransportConfiguration.cs
- CodeStatementCollection.cs
- Point4DConverter.cs
- SamlAdvice.cs
- WindowsRegion.cs
- AjaxFrameworkAssemblyAttribute.cs
- UnsafeNativeMethods.cs
- InputScope.cs
- DataSourceProvider.cs
- SqlCacheDependencySection.cs
- SortedList.cs
- VariableAction.cs
- EventManager.cs
- EnvelopedSignatureTransform.cs
- QilSortKey.cs
- SessionPageStateSection.cs
- Reference.cs
- XmlBoundElement.cs
- MimeTypeMapper.cs
- XamlBrushSerializer.cs
- Axis.cs
- OuterGlowBitmapEffect.cs
- TypeElement.cs
- RectKeyFrameCollection.cs
- FragmentQueryKB.cs
- OutputScopeManager.cs
- FixedSOMTableRow.cs
- PieceDirectory.cs
- DesignObjectWrapper.cs
- Bidi.cs
- xdrvalidator.cs
- CounterSampleCalculator.cs
- AppliedDeviceFiltersEditor.cs
- MethodCallTranslator.cs
- Vars.cs
- LinearKeyFrames.cs
- WebPartExportVerb.cs
- StrongTypingException.cs
- ProfileParameter.cs
- XmlSchemaFacet.cs
- TagMapCollection.cs
- ProxyElement.cs
- MethodAccessException.cs
- CodeConstructor.cs
- Point3DConverter.cs
- Substitution.cs
- EtwProvider.cs
- DescendantQuery.cs
- dataobject.cs
- ProviderBase.cs
- StandardMenuStripVerb.cs
- ConfigurationElement.cs
- SystemMulticastIPAddressInformation.cs
- UserControlBuildProvider.cs
- ToggleProviderWrapper.cs
- AsymmetricKeyExchangeFormatter.cs
- Accessible.cs
- TypeSemantics.cs
- HtmlShimManager.cs
- UIElement.cs
- FormsAuthenticationEventArgs.cs
- RSAPKCS1SignatureFormatter.cs
- XmlLoader.cs
- AnnotationHighlightLayer.cs
- QueryOperationResponseOfT.cs
- SortKey.cs
- RSAPKCS1SignatureFormatter.cs
- WebDescriptionAttribute.cs
- Marshal.cs
- UnionCodeGroup.cs
- RestHandlerFactory.cs
- BuilderPropertyEntry.cs
- SortDescription.cs
- TypeDescriptor.cs
- ControlValuePropertyAttribute.cs
- MexTcpBindingCollectionElement.cs
- ToolStripContainerDesigner.cs
- InternalDispatchObject.cs
- __Filters.cs
- SqlDataReader.cs
- TextReader.cs
- OptimisticConcurrencyException.cs
- CompilerGeneratedAttribute.cs
- Sql8ConformanceChecker.cs
- DataControlButton.cs
- SoapSchemaMember.cs
- WebPartEditorCancelVerb.cs
- TextFindEngine.cs
- cookie.cs
- SqlFileStream.cs
- ObjectItemNoOpAssemblyLoader.cs
- ScrollViewer.cs
- ProcessHostMapPath.cs
- HMACSHA384.cs
- LexicalChunk.cs
- HostExecutionContextManager.cs