Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / ndp / fx / src / XmlUtils / System / Xml / Xsl / XsltOld / TextOnlyOutput.cs / 1 / TextOnlyOutput.cs
//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// [....]
//-----------------------------------------------------------------------------
namespace System.Xml.Xsl.XsltOld {
using Res = System.Xml.Utils.Res;
using System;
using System.IO;
using System.Xml;
using System.Xml.XPath;
using System.Text;
using System.Collections;
internal class TextOnlyOutput : RecordOutput {
private Processor processor;
private TextWriter writer;
internal XsltOutput Output {
get { return this.processor.Output; }
}
public TextWriter Writer {
get { return this.writer; }
}
//
// Constructor
//
internal TextOnlyOutput(Processor processor, Stream stream) {
if (stream == null) {
throw new ArgumentNullException("stream");
}
this.processor = processor;
this.writer = new StreamWriter(stream, Output.Encoding);
}
internal TextOnlyOutput(Processor processor, TextWriter writer) {
if (writer == null) {
throw new ArgumentNullException("writer");
}
this.processor = processor;
this.writer = writer;
}
//
// RecordOutput interface method implementation
//
public Processor.OutputResult RecordDone(RecordBuilder record) {
BuilderInfo mainNode = record.MainNode;
switch (mainNode.NodeType) {
case XmlNodeType.Text:
case XmlNodeType.Whitespace:
case XmlNodeType.SignificantWhitespace:
this.writer.Write(mainNode.Value);
break;
default:
break;
}
record.Reset();
return Processor.OutputResult.Continue;
}
public void TheEnd() {
this.writer.Flush();
}
}
}
// 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.IO;
using System.Xml;
using System.Xml.XPath;
using System.Text;
using System.Collections;
internal class TextOnlyOutput : RecordOutput {
private Processor processor;
private TextWriter writer;
internal XsltOutput Output {
get { return this.processor.Output; }
}
public TextWriter Writer {
get { return this.writer; }
}
//
// Constructor
//
internal TextOnlyOutput(Processor processor, Stream stream) {
if (stream == null) {
throw new ArgumentNullException("stream");
}
this.processor = processor;
this.writer = new StreamWriter(stream, Output.Encoding);
}
internal TextOnlyOutput(Processor processor, TextWriter writer) {
if (writer == null) {
throw new ArgumentNullException("writer");
}
this.processor = processor;
this.writer = writer;
}
//
// RecordOutput interface method implementation
//
public Processor.OutputResult RecordDone(RecordBuilder record) {
BuilderInfo mainNode = record.MainNode;
switch (mainNode.NodeType) {
case XmlNodeType.Text:
case XmlNodeType.Whitespace:
case XmlNodeType.SignificantWhitespace:
this.writer.Write(mainNode.Value);
break;
default:
break;
}
record.Reset();
return Processor.OutputResult.Continue;
}
public void TheEnd() {
this.writer.Flush();
}
}
}
// 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
- ConnectionPoint.cs
- IisTraceListener.cs
- SqlCharStream.cs
- FieldAccessException.cs
- BCLDebug.cs
- ProtocolInformationReader.cs
- RtfControls.cs
- MetadataItemSerializer.cs
- ActionFrame.cs
- PaintValueEventArgs.cs
- EntityDataSourceSelectedEventArgs.cs
- Win32MouseDevice.cs
- MatrixCamera.cs
- DateTimeOffsetStorage.cs
- CompositionAdorner.cs
- AccessText.cs
- ProbeDuplexAsyncResult.cs
- ItemsControl.cs
- SingleSelectRootGridEntry.cs
- TypefaceCollection.cs
- SatelliteContractVersionAttribute.cs
- WebPermission.cs
- BaseAsyncResult.cs
- PagerSettings.cs
- NavigationProperty.cs
- WorkerProcess.cs
- InterleavedZipPartStream.cs
- LightweightCodeGenerator.cs
- SingleConverter.cs
- SystemIPGlobalProperties.cs
- CatalogZone.cs
- TableChangeProcessor.cs
- ExceptionNotification.cs
- ICspAsymmetricAlgorithm.cs
- DataSourceCollectionBase.cs
- StringUtil.cs
- DiagnosticTrace.cs
- RouteValueDictionary.cs
- AppDomain.cs
- RoutedEventValueSerializer.cs
- Logging.cs
- LinkedList.cs
- Char.cs
- FloaterParagraph.cs
- TypeDelegator.cs
- TranslateTransform3D.cs
- DataGridPagerStyle.cs
- IImplicitResourceProvider.cs
- IPAddress.cs
- ConvertEvent.cs
- RelativeSource.cs
- ArrayHelper.cs
- DataGridViewToolTip.cs
- MemoryPressure.cs
- DurationConverter.cs
- AbsoluteQuery.cs
- IListConverters.cs
- WindowsToolbarItemAsMenuItem.cs
- HtmlFormWrapper.cs
- FocusChangedEventArgs.cs
- CachedRequestParams.cs
- SmuggledIUnknown.cs
- StoragePropertyMapping.cs
- XmlSerializationReader.cs
- ConfigViewGenerator.cs
- ItemMap.cs
- isolationinterop.cs
- webeventbuffer.cs
- MouseGestureConverter.cs
- EqualityComparer.cs
- SqlGatherProducedAliases.cs
- WindowsPrincipal.cs
- TriggerBase.cs
- MSAAEventDispatcher.cs
- Brush.cs
- storepermissionattribute.cs
- ColumnCollectionEditor.cs
- AuthorizationRuleCollection.cs
- Encoding.cs
- XsltContext.cs
- AutoFocusStyle.xaml.cs
- SHA256.cs
- ConditionCollection.cs
- InplaceBitmapMetadataWriter.cs
- BulletedList.cs
- DataConnectionHelper.cs
- EventListener.cs
- PrivateUnsafeNativeCompoundFileMethods.cs
- ObjectListShowCommandsEventArgs.cs
- ImageKeyConverter.cs
- FragmentQuery.cs
- EntityDesignerUtils.cs
- LogExtent.cs
- TypeDescriptionProviderAttribute.cs
- EventListenerClientSide.cs
- BufferedGraphics.cs
- RemotingHelper.cs
- HtmlMeta.cs
- DataBoundControlAdapter.cs
- HostedNamedPipeTransportManager.cs