Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / ndp / fx / src / XmlUtils / System / Xml / Xsl / XsltOld / TextAction.cs / 1 / 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 (Keywords.Equals(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 (Keywords.Equals(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
- ServiceBehaviorElement.cs
- ColorBlend.cs
- CultureSpecificCharacterBufferRange.cs
- ProtectedConfigurationSection.cs
- CredentialCache.cs
- DataListItemCollection.cs
- TaiwanCalendar.cs
- Signature.cs
- log.cs
- DataControlHelper.cs
- ClientEndpointLoader.cs
- CustomAttributeFormatException.cs
- HtmlElement.cs
- RijndaelManagedTransform.cs
- RelatedEnd.cs
- X509IssuerSerialKeyIdentifierClause.cs
- DbConnectionPoolCounters.cs
- ServiceDescriptions.cs
- OneWayBindingElement.cs
- InternalRelationshipCollection.cs
- RuntimeHandles.cs
- DataGridViewCellValueEventArgs.cs
- OutputCacheModule.cs
- ChannelManager.cs
- TransactionInterop.cs
- CallbackValidatorAttribute.cs
- Section.cs
- OdbcDataReader.cs
- SingleConverter.cs
- DataGridViewCellLinkedList.cs
- GeometryGroup.cs
- XPathDocument.cs
- TemplateFactory.cs
- ProfileGroupSettingsCollection.cs
- HtmlTernaryTree.cs
- WebEvents.cs
- ErrorEventArgs.cs
- SharedPersonalizationStateInfo.cs
- DbMetaDataColumnNames.cs
- QilReference.cs
- ResourceContainer.cs
- LinkedResourceCollection.cs
- ListItemCollection.cs
- PropertyToken.cs
- Baml2006ReaderSettings.cs
- WebServiceErrorEvent.cs
- DefaultEvaluationContext.cs
- NumericExpr.cs
- OdbcReferenceCollection.cs
- StylusDevice.cs
- TextMetrics.cs
- SchemaInfo.cs
- RubberbandSelector.cs
- ClientConfigPaths.cs
- IndexOutOfRangeException.cs
- Matrix.cs
- GeometryGroup.cs
- DataGridLinkButton.cs
- ObjectStorage.cs
- Timeline.cs
- XmlDataSourceNodeDescriptor.cs
- ColumnWidthChangingEvent.cs
- Marshal.cs
- TrackingStringDictionary.cs
- SocketAddress.cs
- UInt64Converter.cs
- ReaderOutput.cs
- LinqDataSourceStatusEventArgs.cs
- SqlOuterApplyReducer.cs
- XhtmlCssHandler.cs
- PasswordPropertyTextAttribute.cs
- RepeaterCommandEventArgs.cs
- ArglessEventHandlerProxy.cs
- RecordConverter.cs
- SchemaNames.cs
- FontCacheLogic.cs
- CacheRequest.cs
- WebPartMenu.cs
- OutputCacheProfileCollection.cs
- WriteTimeStream.cs
- Model3DGroup.cs
- TaskCanceledException.cs
- OrCondition.cs
- FamilyMap.cs
- CryptoApi.cs
- TableNameAttribute.cs
- TimeSpanConverter.cs
- SBCSCodePageEncoding.cs
- WhitespaceRule.cs
- RenderingEventArgs.cs
- CatalogPartCollection.cs
- EntityDataReader.cs
- TransformationRules.cs
- _SecureChannel.cs
- EmptyEnumerator.cs
- TypeForwardedToAttribute.cs
- ServerValidateEventArgs.cs
- ValidatingReaderNodeData.cs
- StorageSetMapping.cs
- XmlSchemaAny.cs