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
- XPathMultyIterator.cs
- DbConnectionOptions.cs
- ConsoleCancelEventArgs.cs
- DomNameTable.cs
- TextBoxBaseDesigner.cs
- BufferBuilder.cs
- PropertyCondition.cs
- XmlStreamStore.cs
- WebPageTraceListener.cs
- LabelTarget.cs
- MatrixTransform3D.cs
- PathFigure.cs
- MatrixTransform.cs
- XmlSignificantWhitespace.cs
- ComplexTypeEmitter.cs
- BitmapInitialize.cs
- TemplateControlBuildProvider.cs
- CheckoutException.cs
- ConfigurationManagerInternalFactory.cs
- OptionalRstParameters.cs
- CubicEase.cs
- WorkflowRuntime.cs
- BitmapEffectDrawingContextState.cs
- DatagridviewDisplayedBandsData.cs
- _AcceptOverlappedAsyncResult.cs
- QueryableFilterUserControl.cs
- PrivilegedConfigurationManager.cs
- XMLDiffLoader.cs
- VirtualPathUtility.cs
- RichTextBox.cs
- NetworkInformationPermission.cs
- Context.cs
- AppSettingsExpressionBuilder.cs
- ToolStripKeyboardHandlingService.cs
- InvalidDataContractException.cs
- XmlComplianceUtil.cs
- SecurityNegotiationException.cs
- UnionCqlBlock.cs
- XmlElementAttribute.cs
- TableItemPattern.cs
- SequentialOutput.cs
- MediaSystem.cs
- PersonalizationState.cs
- _NegoState.cs
- OrCondition.cs
- CultureTableRecord.cs
- OuterGlowBitmapEffect.cs
- VectorCollectionValueSerializer.cs
- EntityKey.cs
- InvalidPropValue.cs
- ProgressiveCrcCalculatingStream.cs
- SpeechRecognitionEngine.cs
- Int16AnimationBase.cs
- ConditionCollection.cs
- FaultContractInfo.cs
- SHA1Cng.cs
- MemoryFailPoint.cs
- ExpressionDumper.cs
- DrawingVisualDrawingContext.cs
- AtomParser.cs
- Content.cs
- TogglePatternIdentifiers.cs
- UrlAuthFailedErrorFormatter.cs
- _TimerThread.cs
- PtsPage.cs
- DateTimePickerDesigner.cs
- SQLBinaryStorage.cs
- EnumBuilder.cs
- InternalResources.cs
- HwndMouseInputProvider.cs
- HttpValueCollection.cs
- GACMembershipCondition.cs
- DataGridViewCellToolTipTextNeededEventArgs.cs
- XmlEncoding.cs
- BasicCommandTreeVisitor.cs
- LongAverageAggregationOperator.cs
- DependencyObject.cs
- UserMapPath.cs
- SqlNodeAnnotation.cs
- X509CertificateInitiatorClientCredential.cs
- Visual3DCollection.cs
- Suspend.cs
- ConnectionPoint.cs
- CommonObjectSecurity.cs
- OleDbErrorCollection.cs
- DataGridItemCollection.cs
- IriParsingElement.cs
- TypeGeneratedEventArgs.cs
- ImageFormat.cs
- DataBoundControlAdapter.cs
- StaticFileHandler.cs
- KnownColorTable.cs
- ImportCatalogPart.cs
- Bitmap.cs
- CatalogZoneBase.cs
- SecureStringHasher.cs
- RegexStringValidatorAttribute.cs
- DocumentApplicationJournalEntry.cs
- DataGridViewBindingCompleteEventArgs.cs
- SimpleNameService.cs