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
- wpf-etw.cs
- RichTextBox.cs
- SQlBooleanStorage.cs
- ZipFileInfoCollection.cs
- Animatable.cs
- ReaderContextStackData.cs
- ListItemViewAttribute.cs
- wgx_render.cs
- FillErrorEventArgs.cs
- COM2EnumConverter.cs
- AdapterUtil.cs
- Identifier.cs
- AsymmetricKeyExchangeFormatter.cs
- RequestCacheValidator.cs
- EntryPointNotFoundException.cs
- LinqDataSource.cs
- CompositeCollection.cs
- RoleService.cs
- WebServiceMethodData.cs
- ZipIOLocalFileBlock.cs
- Stack.cs
- ColumnHeader.cs
- PlaceHolder.cs
- AgileSafeNativeMemoryHandle.cs
- ScaleTransform.cs
- ToolStripContentPanelRenderEventArgs.cs
- Stroke.cs
- ResourcePart.cs
- MetadataUtil.cs
- StickyNoteContentControl.cs
- FileChangesMonitor.cs
- Root.cs
- ObjectPersistData.cs
- MatrixValueSerializer.cs
- FileEnumerator.cs
- XmlAttributeProperties.cs
- XmlSerializerNamespaces.cs
- Input.cs
- InstanceLockedException.cs
- OdbcEnvironmentHandle.cs
- DataBindEngine.cs
- RegexGroup.cs
- _OverlappedAsyncResult.cs
- DataGridCell.cs
- Table.cs
- ParallelRangeManager.cs
- SharedPerformanceCounter.cs
- DbParameterHelper.cs
- PropertyMetadata.cs
- Filter.cs
- PrimaryKeyTypeConverter.cs
- EncryptedType.cs
- DatePicker.cs
- DataGridViewRowsRemovedEventArgs.cs
- SchemaSetCompiler.cs
- odbcmetadatacollectionnames.cs
- GeneralTransform3DTo2DTo3D.cs
- SqlCachedBuffer.cs
- CompilationSection.cs
- DefaultAuthorizationContext.cs
- SingleStorage.cs
- Vector3DValueSerializer.cs
- HostedNamedPipeTransportManager.cs
- ByteAnimationUsingKeyFrames.cs
- TemplatedMailWebEventProvider.cs
- XmlAttributeOverrides.cs
- MetadataItemSerializer.cs
- SystemUnicastIPAddressInformation.cs
- TypeAccessException.cs
- ExpandableObjectConverter.cs
- SqlVisitor.cs
- WebRequestModuleElementCollection.cs
- ServiceDescriptionImporter.cs
- RemoteWebConfigurationHostServer.cs
- RecordsAffectedEventArgs.cs
- IdnElement.cs
- IntAverageAggregationOperator.cs
- UInt32Storage.cs
- SerializationException.cs
- ControlBindingsCollection.cs
- OutputScopeManager.cs
- WebPartDisplayModeCancelEventArgs.cs
- BindingsSection.cs
- cryptoapiTransform.cs
- FontStretch.cs
- GridViewRowEventArgs.cs
- CheckBoxAutomationPeer.cs
- SqlStatistics.cs
- IisTraceListener.cs
- File.cs
- EndpointDiscoveryElement.cs
- ResourceDefaultValueAttribute.cs
- Grant.cs
- WebPartRestoreVerb.cs
- FileEnumerator.cs
- DataPagerFieldCommandEventArgs.cs
- ConnectionInterfaceCollection.cs
- TraceSection.cs
- PageSettings.cs
- BuildManagerHost.cs