Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / XmlUtils / System / Xml / Xsl / XsltOld / TextAction.cs / 1305376 / TextAction.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; internal class TextAction : CompiledAction { private bool disableOutputEscaping; private string text; internal override void Compile(Compiler compiler) { CompileAttributes(compiler); CompileContent(compiler); } internal override bool CompileAttribute(Compiler compiler) { string name = compiler.Input.LocalName; string value = compiler.Input.Value; if (Ref.Equal(name, compiler.Atoms.DisableOutputEscaping)) { this.disableOutputEscaping = compiler.GetYesNo(value); } else { return false; } return true; } private void CompileContent(Compiler compiler) { if (compiler.Recurse()) { NavigatorInput input = compiler.Input; this.text = string.Empty; do { switch (input.NodeType) { case XPathNodeType.Text: case XPathNodeType.Whitespace: case XPathNodeType.SignificantWhitespace: this.text += input.Value; break; case XPathNodeType.Comment: case XPathNodeType.ProcessingInstruction: break; default: throw compiler.UnexpectedKeyword(); } } while(compiler.Advance()); compiler.ToParent(); } } internal override void Execute(Processor processor, ActionFrame frame) { Debug.Assert(processor != null && frame != null); switch (frame.State) { case Initialized: if (processor.TextEvent(this.text, disableOutputEscaping)) { frame.Finished(); } break; default: Debug.Fail("Invalid execution state in TextAction"); break; } } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------------------------ //// 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; internal class TextAction : CompiledAction { private bool disableOutputEscaping; private string text; internal override void Compile(Compiler compiler) { CompileAttributes(compiler); CompileContent(compiler); } internal override bool CompileAttribute(Compiler compiler) { string name = compiler.Input.LocalName; string value = compiler.Input.Value; if (Ref.Equal(name, compiler.Atoms.DisableOutputEscaping)) { this.disableOutputEscaping = compiler.GetYesNo(value); } else { return false; } return true; } private void CompileContent(Compiler compiler) { if (compiler.Recurse()) { NavigatorInput input = compiler.Input; this.text = string.Empty; do { switch (input.NodeType) { case XPathNodeType.Text: case XPathNodeType.Whitespace: case XPathNodeType.SignificantWhitespace: this.text += input.Value; break; case XPathNodeType.Comment: case XPathNodeType.ProcessingInstruction: break; default: throw compiler.UnexpectedKeyword(); } } while(compiler.Advance()); compiler.ToParent(); } } internal override void Execute(Processor processor, ActionFrame frame) { Debug.Assert(processor != null && frame != null); switch (frame.State) { case Initialized: if (processor.TextEvent(this.text, disableOutputEscaping)) { frame.Finished(); } break; default: Debug.Fail("Invalid execution state in TextAction"); 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
- ReferenceSchema.cs
- OrderedDictionary.cs
- PaintEvent.cs
- FragmentQuery.cs
- NameSpaceEvent.cs
- Helpers.cs
- DbConvert.cs
- filewebresponse.cs
- RenderData.cs
- SafeEventHandle.cs
- CompilerErrorCollection.cs
- WebPartAddingEventArgs.cs
- ConfigViewGenerator.cs
- PersistChildrenAttribute.cs
- NameValueSectionHandler.cs
- BaseTemplatedMobileComponentEditor.cs
- MessageBox.cs
- UrlUtility.cs
- WindowsListView.cs
- DecoderReplacementFallback.cs
- GeometryValueSerializer.cs
- WindowsGraphics.cs
- HostingEnvironment.cs
- DotNetATv1WindowsLogEntryDeserializer.cs
- PageVisual.cs
- Error.cs
- AnnouncementEndpoint.cs
- BamlWriter.cs
- DateTimeParse.cs
- CuspData.cs
- MsmqReceiveParameters.cs
- COM2PictureConverter.cs
- ParagraphResult.cs
- ComponentManagerBroker.cs
- HostingEnvironment.cs
- DBAsyncResult.cs
- BitmapFrame.cs
- Vector3DCollectionValueSerializer.cs
- Span.cs
- RegexMatchCollection.cs
- SiteMapProvider.cs
- TakeQueryOptionExpression.cs
- SizeLimitedCache.cs
- InputBuffer.cs
- FileVersionInfo.cs
- StrokeNodeOperations.cs
- StreamAsIStream.cs
- ValuePattern.cs
- XPathArrayIterator.cs
- NavigationWindow.cs
- EpmSyndicationContentDeSerializer.cs
- BitArray.cs
- StringCollection.cs
- StdValidatorsAndConverters.cs
- ElapsedEventArgs.cs
- ComplexLine.cs
- ProviderIncompatibleException.cs
- SafeFileMappingHandle.cs
- StringConcat.cs
- PropertyDescriptorGridEntry.cs
- Tile.cs
- Nodes.cs
- BlurEffect.cs
- ResizeGrip.cs
- ListViewCommandEventArgs.cs
- DoubleIndependentAnimationStorage.cs
- MD5.cs
- Constraint.cs
- CollectionContainer.cs
- MemberMemberBinding.cs
- TraceProvider.cs
- ConfigurationHelpers.cs
- AnchoredBlock.cs
- DesignerCatalogPartChrome.cs
- ArgIterator.cs
- ColorConvertedBitmap.cs
- InheritablePropertyChangeInfo.cs
- EndpointAddressElementBase.cs
- SoapElementAttribute.cs
- XslNumber.cs
- DefaultShape.cs
- TTSVoice.cs
- OrderedDictionary.cs
- ToolStripItemImageRenderEventArgs.cs
- XMLUtil.cs
- UnionQueryOperator.cs
- AvTraceFormat.cs
- ModelItemKeyValuePair.cs
- WebHttpBinding.cs
- OleDbConnectionFactory.cs
- PropertyPath.cs
- GlobalItem.cs
- Transactions.cs
- AsyncCallback.cs
- SqlTriggerAttribute.cs
- ReferencedCollectionType.cs
- PrimitiveXmlSerializers.cs
- AsyncContentLoadedEventArgs.cs
- XmlDataLoader.cs
- ListMarkerSourceInfo.cs