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
- XmlHierarchicalDataSourceView.cs
- XmlSchemaIdentityConstraint.cs
- LockedActivityGlyph.cs
- Grant.cs
- HandlerMappingMemo.cs
- FtpCachePolicyElement.cs
- MenuItemStyleCollection.cs
- CodeBlockBuilder.cs
- AspNetSynchronizationContext.cs
- MutexSecurity.cs
- MultiView.cs
- BuildResultCache.cs
- DataGrid.cs
- LineInfo.cs
- HostingEnvironment.cs
- Pair.cs
- DecoderReplacementFallback.cs
- DesignerCalendarAdapter.cs
- XsltArgumentList.cs
- ComponentCodeDomSerializer.cs
- PrintPreviewDialog.cs
- ThemeableAttribute.cs
- NaturalLanguageHyphenator.cs
- BStrWrapper.cs
- XmlText.cs
- DropDownList.cs
- SystemUnicastIPAddressInformation.cs
- ProxyHwnd.cs
- _HelperAsyncResults.cs
- ImageAttributes.cs
- SendMailErrorEventArgs.cs
- Source.cs
- InternalMappingException.cs
- NamedElement.cs
- SamlNameIdentifierClaimResource.cs
- ObjectQueryState.cs
- WebPartEditorOkVerb.cs
- ExtensionWindow.cs
- EdmProviderManifest.cs
- errorpatternmatcher.cs
- MulticastOption.cs
- BrushConverter.cs
- CacheEntry.cs
- XmlCollation.cs
- XmlSchemaInfo.cs
- MailBnfHelper.cs
- CodeTypeParameter.cs
- CodeDomLoader.cs
- LateBoundBitmapDecoder.cs
- EditorPartChrome.cs
- DoubleAnimationUsingKeyFrames.cs
- EventLogQuery.cs
- TextMarkerSource.cs
- CompositeFontFamily.cs
- SignatureHelper.cs
- MethodBody.cs
- ResXResourceReader.cs
- CompiledXpathExpr.cs
- HttpChannelBindingToken.cs
- _SslSessionsCache.cs
- Attribute.cs
- WaitHandleCannotBeOpenedException.cs
- HttpFileCollection.cs
- CFStream.cs
- BindingOperations.cs
- DbConnectionClosed.cs
- SqlDataSourceStatusEventArgs.cs
- StringReader.cs
- ToolBar.cs
- ReflectionPermission.cs
- ShapingEngine.cs
- MdImport.cs
- OleDbInfoMessageEvent.cs
- SimpleFileLog.cs
- CheckBoxAutomationPeer.cs
- SweepDirectionValidation.cs
- LogPolicy.cs
- FocusTracker.cs
- ListBox.cs
- TextEditorTables.cs
- ListBase.cs
- TextTreeDeleteContentUndoUnit.cs
- TypeGeneratedEventArgs.cs
- Timer.cs
- TextMetrics.cs
- Menu.cs
- ReaderWriterLock.cs
- ObjectDataSourceStatusEventArgs.cs
- configsystem.cs
- TreeView.cs
- IndentedTextWriter.cs
- Int32Animation.cs
- Knowncolors.cs
- EncoderParameters.cs
- OdbcFactory.cs
- InputLanguage.cs
- ForceCopyBuildProvider.cs
- CatalogPartChrome.cs
- Pts.cs
- ServiceModelConfigurationSection.cs