Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / 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
- SQLBytesStorage.cs
- UnsafeNativeMethods.cs
- PersistenceMetadataNamespace.cs
- VisualTreeUtils.cs
- SimpleTableProvider.cs
- TraceSection.cs
- DataGrid.cs
- DescendantBaseQuery.cs
- DbCommandTree.cs
- HttpCacheVary.cs
- WorkflowServiceHostFactory.cs
- DataGridViewCellValidatingEventArgs.cs
- CriticalFinalizerObject.cs
- Base64Decoder.cs
- DataGridViewTextBoxColumn.cs
- AssemblyCollection.cs
- ValidateNames.cs
- AmbientProperties.cs
- CheckBoxPopupAdapter.cs
- XmlReflectionMember.cs
- PropertyChangedEventManager.cs
- SymmetricKey.cs
- CollectionDataContract.cs
- Socket.cs
- CmsInterop.cs
- HtmlInputFile.cs
- Choices.cs
- RelationshipEndCollection.cs
- TripleDES.cs
- PerspectiveCamera.cs
- XmlEnumAttribute.cs
- DataGridViewRowsRemovedEventArgs.cs
- DesignerAttribute.cs
- Expression.cs
- StorageMappingItemLoader.cs
- GeometryGroup.cs
- FixedSOMLineCollection.cs
- HMACSHA1.cs
- WebBrowserProgressChangedEventHandler.cs
- PackWebRequestFactory.cs
- DataGridViewAdvancedBorderStyle.cs
- LowerCaseStringConverter.cs
- TextEndOfLine.cs
- GridItem.cs
- PolicyConversionContext.cs
- PhysicalAddress.cs
- VScrollBar.cs
- SQLGuidStorage.cs
- UniqueIdentifierService.cs
- HostingEnvironmentWrapper.cs
- CodeEntryPointMethod.cs
- IApplicationTrustManager.cs
- ModelTreeManager.cs
- SafeBuffer.cs
- AuthenticationModuleElementCollection.cs
- TextWriterTraceListener.cs
- SectionVisual.cs
- InstanceDataCollectionCollection.cs
- FileDialogCustomPlacesCollection.cs
- GridViewColumnHeader.cs
- Compiler.cs
- VisualBrush.cs
- RouteParameter.cs
- _ConnectionGroup.cs
- RankException.cs
- ADConnectionHelper.cs
- MarkerProperties.cs
- ReachDocumentPageSerializer.cs
- ToolboxItemImageConverter.cs
- WeakEventManager.cs
- FloatMinMaxAggregationOperator.cs
- XDRSchema.cs
- HtmlTextArea.cs
- XMLSyntaxException.cs
- NetTcpSection.cs
- ColumnResult.cs
- MemoryPressure.cs
- CodeStatementCollection.cs
- ExpandableObjectConverter.cs
- RepeatButtonAutomationPeer.cs
- Int32RectConverter.cs
- DeferredTextReference.cs
- Double.cs
- SystemWebExtensionsSectionGroup.cs
- SendMessageRecord.cs
- HostingEnvironmentWrapper.cs
- HelloOperation11AsyncResult.cs
- Baml2006Reader.cs
- ReadOnlyPropertyMetadata.cs
- ObsoleteAttribute.cs
- TextPatternIdentifiers.cs
- COM2IVsPerPropertyBrowsingHandler.cs
- Line.cs
- CatalogPartChrome.cs
- VoiceSynthesis.cs
- SafeTimerHandle.cs
- ValueSerializerAttribute.cs
- SolidBrush.cs
- ByteStorage.cs
- OdbcConnectionHandle.cs