Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / 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
- ObjectDataSource.cs
- GeometryConverter.cs
- DatagridviewDisplayedBandsData.cs
- OptimalTextSource.cs
- PathSegmentCollection.cs
- WpfSharedBamlSchemaContext.cs
- MultilineStringConverter.cs
- ObjectDataSourceEventArgs.cs
- EntityDataSourceChangedEventArgs.cs
- MouseBinding.cs
- UniqueIdentifierService.cs
- EntitySqlException.cs
- FontUnit.cs
- Converter.cs
- TransportContext.cs
- panel.cs
- DXD.cs
- CrossContextChannel.cs
- Transaction.cs
- ReadOnlyDataSourceView.cs
- TdsParserSafeHandles.cs
- ListViewGroupConverter.cs
- TimeSpanMinutesConverter.cs
- TreeChangeInfo.cs
- SoapFault.cs
- ComboBoxAutomationPeer.cs
- StreamedFramingRequestChannel.cs
- LeafCellTreeNode.cs
- StylusTip.cs
- SmtpLoginAuthenticationModule.cs
- XmlILStorageConverter.cs
- ExpandSegmentCollection.cs
- _ReceiveMessageOverlappedAsyncResult.cs
- ParallelActivityDesigner.cs
- DrawingVisual.cs
- RSAPKCS1KeyExchangeDeformatter.cs
- ImmutableDispatchRuntime.cs
- UpdateCompiler.cs
- PreservationFileReader.cs
- DelayedRegex.cs
- PermissionSetTriple.cs
- TableLayoutColumnStyleCollection.cs
- SettingsPropertyNotFoundException.cs
- SharedHttpsTransportManager.cs
- DataControlField.cs
- HtmlImage.cs
- ProfilePropertyNameValidator.cs
- EventRoute.cs
- TerminatorSinks.cs
- StringValidator.cs
- ServiceErrorHandler.cs
- SemanticKeyElement.cs
- FormsAuthenticationEventArgs.cs
- HttpDictionary.cs
- PagesChangedEventArgs.cs
- SystemKeyConverter.cs
- CapabilitiesState.cs
- GraphicsState.cs
- XmlName.cs
- BitmapPalette.cs
- Material.cs
- MarginsConverter.cs
- CalendarTable.cs
- WorkflowLayouts.cs
- CodeBlockBuilder.cs
- FileEnumerator.cs
- EventListenerClientSide.cs
- SymmetricAlgorithm.cs
- GridItemProviderWrapper.cs
- MarkupExtensionSerializer.cs
- DeobfuscatingStream.cs
- ResourceDisplayNameAttribute.cs
- IISUnsafeMethods.cs
- BezierSegment.cs
- XhtmlBasicSelectionListAdapter.cs
- ToolStripSplitButton.cs
- WebPartMinimizeVerb.cs
- ReliabilityContractAttribute.cs
- UIElement.cs
- EditorAttribute.cs
- WebPartCancelEventArgs.cs
- BaseUriHelper.cs
- InkCanvasAutomationPeer.cs
- IPEndPointCollection.cs
- DataPagerField.cs
- WebServiceErrorEvent.cs
- ValidationSummary.cs
- Bits.cs
- AspNetHostingPermission.cs
- XsdBuildProvider.cs
- SafeRegistryHandle.cs
- WebPartVerbCollection.cs
- InputMethodStateTypeInfo.cs
- XmlAttributes.cs
- Style.cs
- LockRecursionException.cs
- SecurityUtils.cs
- Section.cs
- UnsafeNativeMethods.cs
- EditCommandColumn.cs